Code quality
What are complexity metrics?
Measuring how convoluted code is, typically cyclomatic or cognitive complexity per function.
Cyclomatic complexity counts independent paths through a function; cognitive complexity weights that by how hard the structure is for a human to follow. Both are proxies for how likely code is to hide a defect and how painful it will be to test.
Complexity is most useful as a trend and as a gate ('no new function above this threshold') rather than as a score to chase. Absolute numbers vary too much between languages and problem domains to compare across teams.
What to look for
- Which metric is used, and whether the threshold is configurable
- Function-level reporting rather than only file or repository averages
- Whether complexity can fail a build or only appear on a dashboard
- Trend tracking over time, which is more useful than a snapshot
Best 9 code quality, security and code review tools with complexity metrics
Every tool in the directory whose documentation covers this, 6 fully and 3 partially. Full support is shown first. Shown in a random order that changes on every visit, so no tool gets an advantage from its position.
Support is not the same as parity, since some implementations are narrower in scope, gated to a higher plan tier, or maintained only for existing customers. The note under each tool is what its own documentation describes.
Code Quality Platform
Cyclomatic complexity via Lizard and detekt; feeds the repository A-F grade.
PR Review Tool
Cyclomatic complexity analysis with complex-function identification and refactoring suggestions
Code Quality Platform
Code Health combines 25+ factors including nesting depth; cyclomatic complexity weighted low for poor predictive value
Code Quality Platform
Configurable cyclomatic complexity thresholds (low to critical) plus a Complexity Report Card dimension.
Code Quality Platform
First-party cognitive complexity engine plus cyclomatic complexity at file, directory and project level
Code Quality Platform
Complexity metrics reported alongside issue density and distribution measures.
Code Security Platform
AI rules flag long functions and deep nesting; no computed complexity metric.
Code Security Platform
Flags deeply-nested logic/complex one-liners qualitatively; no tracked complexity number
PR Review Tool
Custom rules can cap function length and complexity; no computed complexity metrics reported
Related terms
FAQ
What are complexity metrics?
Measuring how convoluted code is, typically cyclomatic or cognitive complexity per function.
How many tools in the directory offer complexity metrics?
9 of the 20 tools in this directory offer complexity metrics, 6 fully and 3 partially:
Support is not the same as parity, since some implementations are narrower in scope, gated to a higher plan tier, or maintained only for existing customers. The note under each tool is what its own documentation describes.
What should you check when comparing tools with complexity metrics?
Four things:
- Which metric is used, and whether the threshold is configurable
- Function-level reporting rather than only file or repository averages
- Whether complexity can fail a build or only appear on a dashboard
- Trend tracking over time, which is more useful than a snapshot