Synopsis: | The cyclomatic complexity of a method should not exceed its configured maximum. |
Language: | C# |
Severity Level: | 4 |
Category: | Control flow |
Description: |
'Cyclomatic complexity' is a software metric (measurement) that directly measures the number of linearly independent paths through a program's source code. For an often used testing strategy such as 'Basis Path Testing' (McCabe) the number of test cases will equal the cyclomatic complexity. Many studies have found a strong positive correlation between the cyclomatic complexity and the number of defects contained in a module. As such a 'high' (i.e. bigger than configured max) cyclomatic complexity is an indication of potential defects and/or testability problems. |