Subcapability 05 of 05 · Software Engineering & Architecture

Code Quality & Craft

SonarQube Quality Gates, Technical Debt Ratio and Cognitive Complexity metrics that keep delivery velocity sustainable and prevent silent technical debt accumulation from becoming the invisible bottleneck of every future release.

What is at stake

The team delivers features at the right speed in the first months. Then the pace falls. A new feature that took a week now takes two. Then three. The investigation reveals the same pattern: technical debt accumulated silently, without metrics, without a plan. The code that worked as an engine became an anchor, and nobody can point to when the turn happened.

What it is, in practice

Quality perceived as cost is the most expensive economic mistake in engineering. Every extra Cognitive Complexity point charges interest on every future feature. The team that does not measure quality only suffers it. The silent accumulation is invisible in the first year and causes delivery freeze in the third. Undeclared technical debt does not disappear. It compounds, and compounding is exponential.

How we work

Measurable gains

What changes in the result when this subcapability matures.

Frequently asked questions

Is technical debt the same as bad code?

Technical debt is the future cost of decisions that were correct in the original context and became inadequate as the system evolved. It includes code that worked when written but no longer reflects the current business model, tests that do not cover paths that became critical and architectures that do not scale to the volume the system reached. Bad code is a subset. Technical debt is broader.

How to calculate the Technical Debt Ratio?

The SQALE Technical Debt Ratio is the ratio between the estimated remediation time for all quality issues and the estimated total development time for the system. Tools like SonarQube calculate automatically based on detected issues and remediation times parametrized by issue type. A Technical Debt Ratio above 5% is considered elevated and begins to measurably impact delivery velocity.

What is Cognitive Complexity and why is it better than Cyclomatic Complexity?

Cyclomatic Complexity counts execution paths in code. Cognitive Complexity, a metric introduced by SonarSource, measures the mental effort required to understand the code. A function with multiple levels of nesting and chained control structures may have moderate Cyclomatic Complexity and high Cognitive Complexity. What matters for development velocity is the effort of understanding, not the number of paths.

Does code review create a bottleneck as the team grows?

Code review creates a bottleneck when it is seen as a quality gate that every change must cross before advancing. Code review as knowledge transfer scales differently: not every change needs the same review level, established patterns reduce review time for code that follows them and pair programming resolves complex cases before the code is written. The process calibrated by risk and complexity does not scale linearly with the team.

How to start a technical debt reduction program without stopping development?

With the opportunistic refactoring approach: each code change leaves the touched module in a better state than found. No separate cleanup project, no dedicated sprint. Improvement happens as a byproduct of normal development. For debt concentrated in specific modules with high impact on delivery velocity, periodic consolidation sprints, one per quarter, address the highest-cost points without stopping the delivery flow.

Want clarity on where to invest first?

A complete technology capability assessment with an evolution roadmap connected to financial result.