Free ToolBy GitIntel

Measure Complexity Before It Measures You

Cyclomatic complexity, cognitive load, maintainability index — file by file.

GitIntel tracks AI-generated code across your entire git history — giving every tool on this page the attribution layer that standard dev tooling misses.

Measure Your Codebase with GitIntel

Cyclomatic complexity is the oldest metric for predicting where bugs will live. Functions with cyclomatic complexity above 10 have statistically higher defect rates. Cognitive complexity — a newer metric from SonarSource — measures how hard code is to understand, not just how many paths it has. Both matter, and they often diverge.

The problem in 2026 is that AI coding tools generate high-complexity code at speed. GitClear's analysis of 153 million lines found AI tools drove code churn up 41% and refactoring to a 10-year low. Developers are shipping complex functions they didn't write and don't fully understand, creating compounding maintainability debt.

GitIntel's complexity analysis adds the attribution dimension: it shows not just which functions are most complex, but whether they were written by AI or human authors. This matters because AI-generated high-complexity code lacks the implicit design rationale a human author could explain — making it harder to safely simplify later.

Run `gitintel complexity` to get per-file and per-function scores, sorted by risk. The output flags functions above configurable thresholds and shows which ones are AI-generated, so your refactor queue has the full picture.

Frequently Asked Questions

What's the difference between cyclomatic and cognitive complexity?

Cyclomatic complexity counts the number of linearly independent paths through code. Cognitive complexity measures how difficult the code is to read — accounting for nesting, recursion, and logical jumps. A function can score low on one and high on the other.

Which languages are supported?

GitIntel currently supports TypeScript, JavaScript, Python, Go, and Rust. Java and C++ support is on the roadmap.

What complexity threshold should I target?

The common guidance is cyclomatic complexity ≤ 10 per function and cognitive complexity ≤ 15. Functions above those thresholds correlate with higher defect rates in peer-reviewed studies.

Start Using GitIntel Free

Open source. No account required. Works on any git repository.