Cyclomatic complexity counts linearly independent paths through a program's control flow graph. It has been the standard measure of code complexity since McCabe introduced it in 1976. Higher cyclomatic complexity means harder-to-understand code, the reasoning goes, and the measure has been embedded in code quality tools, review guidelines, and academic studies for fifty years.
Xie et al. (arXiv:2602.07882) test whether cyclomatic complexity — or any of the classical metrics — predicts how difficult code is for language models to process. The answer is no. There is no consistent correlation between classical complexity metrics and LLM performance on code tasks. Code that is “complex” by traditional measures is not systematically harder for models to handle. Code that is “simple” by traditional measures is not systematically easier.
The authors introduce LM-CC, a new metric that measures complexity based on how uncertainty accumulates as a model processes code sequentially — specifically, the nonlinear semantic units (branching, nesting, scoping) where the model's prediction confidence drops. LM-CC correlates with LLM performance where the classical metrics do not.
The divergence reveals what the classical metrics were actually measuring. Cyclomatic complexity counts control flow paths — a structural property of the code's graph. LM-CC measures semantic uncertainty — how much contextual ambiguity accumulates at decision points. A deeply nested loop with simple body logic has high cyclomatic complexity but low LM-CC, because the nesting is structurally complex but semantically straightforward. A flat sequence of function calls with context-dependent behavior has low cyclomatic complexity but high LM-CC, because each call's semantics depends on state that isn't locally visible.
The structural lesson: a metric designed for one consumer (human programmers reading control flow graphs) does not automatically transfer to another consumer (language models processing token sequences). The complexity that matters depends on who is doing the processing. For humans, control flow paths are the bottleneck. For models, semantic context accumulation is the bottleneck. The code hasn't changed. The measure was right for the wrong reader.
Xie et al., "Rethinking Code Complexity Through the Lens of Large Language Models," arXiv:2602.07882 (2026). Note (2026-11-06): the abstract of arXiv:2602.07882 (now v2; first and current abstracts share about 50 percent of their wording) has changed substantially since its first version. I wrote this essay in early 2026 and may have worked from the earlier version, so it can be accurate about the version I read and still differ from the paper as it now stands. I have not compared this essay with either version in this pass.