Verification · Static analysis
Complexity limits
Measures cyclomatic complexity, function length and nesting and fails when a change pushes a function past a limit.
Sub-techniques
-
Complexity thresholds
V1012.001Per-function limits on cyclomatic or cognitive complexity.
-
Size budgets
V1012.002Limits on function, file and parameter counts.
How to build it
- Measure the current distribution and set the limit at the existing worst case.
- Lower it over time; never block on files the change did not touch.
- Prefer a linter rule (ruff C901, ESLint complexity) over a separate tool.
Signals in a repository
- max-complexity or complexity rules in linter config.
- radon or lizard reports in CI.