scitools.com

← Metric catalog

Cyclomatic Complexity is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.

Cyclomatic Complexity

API ID: Cyclomatic
Also Known As: Cyclomatic Complexity (CC)
Languages: Ada, Assembly, Basic, C#, C++, Fortran, Java, Jovial, Pascal, Python, Rust, VHDL, Web
Targets: Files, Functions, Modules, Packages, Subprograms

McCabe Cyclomatic Complexity, the number of decision points + 1.

McCabe Cyclomatic complexity as per the original NIST paper on the subject. The cyclomatic complexity of any structured program with only one entrance point and one exit point is equal to the number of decision points contained in that program plus one. Understand counts the keywords for decision points (FOR, WHILE, etc) and then adds 1. For a switch statement, each 'case' is counted as 1. For languages with macros, the expanded macro text is also included in the calculation.

Also known as McCabe - Cyclomatic Complexity (CC).


Targets By Language: Configuration: