Skip to main content

cyclomatic_complexity

Limit for the number of linearly independent paths through a program's source code.

Counts the number of code branches and loop statements within function and method bodies.

Example config:

This configuration will allow 10 code branchings per function body before triggering a warning.

custom_lint:
rules:
- cyclomatic_complexity:
max_complexity: 10

Parameters

max_complexity (int)

Threshold cyclomatic complexity level, exceeding it triggers a warning.