Docs/Getting Started/Guide: Code Quality

Guide: Code Quality

Code quality is critical for stable and maintainable software. Use these metrics to assess code quality across your organization and squads.

Metrics to Monitor

Change Failure Rate (DORA Metrics)

  • Why it matters: High failure rates indicate fragile deployments or inadequate testing.
  • How to use: Improve testing, code reviews, and deployment processes.

PRs Merged without Review (Collaboration Snapshot)

  • Why it matters: Unreviewed PRs increase the risk of defects.
  • How to use: Establish strict review guidelines and monitor for non-compliance.

Issues Caught in Reviews (Code Review Metrics)

  • Why it matters: Indicates the effectiveness of code reviews in catching problems early.
  • How to use: What an Increase Means: A higher number of issues caught during reviews can signify a thorough and effective review process, ensuring that potential problems are identified and addressed early. However, consistently high numbers might also indicate deeper issues, such as unclear requirements, rushed coding practices, or insufficient pre-review testing.What a Decline Means:

A decline in issues caught could suggest that reviews are becoming less effective, potentially due to rushed or superficial reviews, lack of engagement, or reduced attention to detail. It might also indicate improved initial code quality, but it’s essential to cross-reference with other metrics (e.g., Change Failure Rate) to confirm this assumption.

Rework and Refactor (Work Breakdown Metrics)

  • Why it matters: Indicates how much effort is spent on improving or fixing existing code.
  • How to use: Balance rework and refactoring with feature development to maintain quality without slowing down progress.

Summary

Monitoring code quality is essential to maintaining a reliable, scalable, and efficient codebase. By tracking metrics such as Issues Caught in Reviews,PR Size, and Unreviewed PRs, engineering managers can gain actionable insights into the health of their development process.

For example, a consistent decline in issues caught during reviews might indicate less thorough reviews, signaling the need for better review practices or enhanced training. Conversely, high PR sizes could slow down reviews and increase the risk of introducing defects. By addressing these patterns, you can ensure that code reviews remain a strong quality gate.

Effective monitoring helps teams strike the right balance between delivery speed and maintaining high code quality standards, ultimately reducing production risks and fostering long-term team efficiency.