TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
C# Coding Standard

Rule:  6@201Checked automatically with code checker

Synopsis:The cyclomatic complexity of a method should not exceed its configured maximum.
Severity Level:4
Category:Control flow


'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.