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.

plugins:
solid_lints:
diagnostics:
cyclomatic_complexity:
max_complexity: 10

Parameters

max_complexity (int)

Threshold cyclomatic complexity level, exceeding it triggers a warning.

exclude (String | Map | List<String | Map>)

A list of methods that should be excluded from the lint.