Introduce rule for cyclomatic complexity #4020
Replies: 4 comments 1 reply
-
Is this the paper describing "Cognitive Complexity"? https://www.sonarsource.com/docs/CognitiveComplexity.pdf |
Beta Was this translation helpful? Give feedback.
-
Yes, I believe that’s the one the SonarJS implementation is based on. It suggests a number of improvements over simple cyclomatic complexity, as used by the stock ESLint rule. |
Beta Was this translation helpful? Give feedback.
-
It's not yet done, but I've started implementation of this in my branch: https://github.com/arendjr/rome-tools/tree/cognitive-complexity |
Beta Was this translation helpful? Give feedback.
-
Rule is merged :) |
Beta Was this translation helpful? Give feedback.
-
I would like Rome to have a lint rule that can enforce a maximum cyclomatic complexity.
At my work we heavily rely on this rule with ESLint in order to flag when it’s time to refactor/split a function because it’s becoming too complex.
Prior art:
Beta Was this translation helpful? Give feedback.
All reactions