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

Rule:  6@201Checked automatically with code checker

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.

The default configured cyclomatic complexity maximum value is 25.
The number of 25 is based on a wide experience from the field.