A developer recounts a CI failure triggered by SonarQube flagging high cyclomatic complexity in a file written by the Codex AI coding agent. Inspection showed Codex had packed entire components onto single lines, but the logic was correct and appropriately handled edge cases; the developer simply instructed Codex to refactor the file into ten smaller files to satisfy the linter, and CI passed.
blog.adrq.dev
· 2026-10-27
A technical guide details Cyclomatic Complexity (CC), a decades-old code metric originated by Thomas McCabe in 1976 that counts independent execution paths through a method by tallying branching constructs like if, while, for, case, and logical operators. It outlines the scoring scale—1 for a single path, roughly 10 as McCabe's recommended ceiling, and above 25 flagged as excessive by Microsoft's CA1502 analyzer—and shows how to compute, visualize, and interpret it in .NET codebases alongside test coverage and IL-level analysis.
blog.ndepend.com
· 2026-09-16