Code Complexity measures the structural intricacy of the codebase using metrics such as cyclomatic complexity and cognitive complexity scores. High complexity in modules correlates with increased defect density, longer review times, and greater difficulty in onboarding new contributors. Monitoring complexity trends helps teams identify areas that need refactoring before they become maintenance bottlenecks.
Structural intricacy of code. Cyclomatic >20 = high risk of defects.
Per-module complexity is unchanged, but cross-module dependency complexity is more visible (and enforceable) in a monorepo. Tools like Nx's project graph make hidden complexity explicit.
Per-module complexity is stable, but cross-module dependency complexity grows superlinearly. Becomes harder to reason about system-wide behavior at scale.
Bug density rises above threshold.
Deeply nested logic consumes working memory.
Reviewers must build mental model first.
Complex code → workarounds → more debt.