For software engineering metrics, what are some guidelines on the maximum permissible linearly-independent cyclomatic complexity? For a properly designed module, what is the upper-bound on cyclomatic complexity?
Asked
Active
Viewed 41 times
1 Answers
1
The recommendation in the documentation of the tool NDepend concerning method Cyclomatic Complexity is:
Methods where CC is higher than 15 are hard to understand and maintain.
Methods where CC is higher than 30 are extremely complex and should be split into smaller methods (except if they are automatically generated by a tool).
For a properly designed module, what is the upper-bound on cyclomatic complexity?
CC applies well on methods because a method is a unit of code flow understanding. There are other metrics to estimate the classes and modules (as a grape of classes) design and complexity like for example:
Disclaimer: I work for NDepend

Patrick from NDepend team
- 13,237
- 6
- 61
- 92
-
For tool generated methods, what is the recommended CC limit? – Eugene Feb 15 '21 at 02:55
-
It really depends if you control or not what is generated. If yes, same limits as your code, if no, no limit. This is why we propose to make a distinction between JustMyCode and NotYourCode both code regions are treated differently by the rule system https://www.ndepend.com/docs/cqlinq-syntax#NotMyCode – Patrick from NDepend team Feb 16 '21 at 06:59