You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We refactored a linter, and suddenly the complexity jumped up. It's not immediately clear why / where to focus efforts on reducing complexity. The complexity is now "20" but it really requires a deep understanding of the metric to reason about what that means.
One idea is to offer a function helping diagnose complexity. For example, it was helpful in my case to examine leave-one-out complexity, i.e. the complexity of individual expressions and of the tree excluding each expression:
Now, we can be hit with hard-to-use information about changes in code complexity.
Example:
r-lib/lintr@d740159
We refactored a linter, and suddenly the complexity jumped up. It's not immediately clear why / where to focus efforts on reducing complexity. The complexity is now "20" but it really requires a deep understanding of the metric to reason about what that means.
One idea is to offer a function helping diagnose complexity. For example, it was helpful in my case to examine leave-one-out complexity, i.e. the complexity of individual expressions and of the tree excluding each expression:
With this output it's clear I need to focus on expression 8 and/or 11 -- excluding those gives much lower complexity.
The text was updated successfully, but these errors were encountered: