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.