When Codex writes 15 components on single lines: SonarQube flags agent-built code debt

bibryam · x · 2026-11-02

Adrian Quiroga recounts a CI failure in his finely tuned agentic coding workflow: SonarQube flagged App.tsx for cyclomatic complexity. Inspection revealed Codex had crammed 15 complete React components, each onto a single line, inside a 30-line file.

Crucially, Codex didn't care about readability or complexity—only correctness—so it kept happily iterating on that file across multiple features. After reviewing the logic, the author confirmed it was all correct (slightly over-engineered, but complexity was warranted by requirements).

He then had Codex refactor and split the file into 10 modules to satisfy SonarQube, and CI passed. Takeaway: agent-written code can be fully correct yet accumulate human-maintainability debt, making static analysis an essential guardrail in agentic workflows.

Original post →

More from coding & agent

coding & agent channel →