Cyclomatic Complexity

Definition of cyclomatic complexity

Cyclomatic complexity, sometimes referred to as McCabe's complexity, is a count of the linearly independent paths through source code. You can also think of this more simply as "the number of decisions a given block of code needs to make".

Most languages provide similar constructs (if, while etc) for "decision" points. For a more comprehensive understanding of Cyclomatic Complexity, Radon, a static analysis tool which checks the cyclomatic complexity of Python code (engine), provides a bit more detail including the impact of specific statements on Cyclomatic Complexity.

Engines which compute Cyclomatic Complexity

Further resources and reading