All chapters in this track
- 01Chapter 1: Why Code Review Exists: Quality, Mentorship, Knowledge Sharing, Shared Ownership
- 02Chapter 2: Author-Side Practices: Small PRs and Self-Review
- 03Chapter 3: Writing PR Descriptions That Get Reviewed Faster
- 04Chapter 4: Reviewer-Side Practices: What to Actually Check
- 05Chapter 5: Review Checklists: Functional and Non-Functional
- 06Chapter 6: Giving Feedback Well: Nits vs. Blocking Issues, Tone, Positive Intent
- 07Chapter 7: Asking Questions vs. Issuing Commands
- 08Chapter 8: Handling Disagreement and Escalation
- 09Chapter 9: Tooling and Process: PR Templates, Required Reviewers, SLAs, CI as a Gate
- 10Chapter 10: Remote and Asynchronous Review Etiquette
- 11Chapter 11: Anti-Patterns: Rubber-Stamping, Bikeshedding, Gatekeeping, Reviewer Fatigue
- 12Chapter 12: Measuring and Improving Review Health Without Weaponizing Metrics
- 13Chapter 13: Worked Example: Reviewing a Real, Flawed Pull Request
- 14Chapter 14: Worked Example: Handling a Contentious Review Disagreement
- 15Chapter 15: How to Talk About Code Review in an Interview
Chapter 12 of 15
Chapter 12: Measuring and Improving Review Health Without Weaponizing Metrics
Why this matters
"You can't improve what you don't measure" is true of code review the same as anything else — but review metrics are unusually easy to weaponize, turning a diagnostic tool meant to improve a team's process into a surveillance mechanism that damages the exact trust and psychological safety good code review depends on. This chapter covers useful review metrics and, just as importantly, the specific ways they get misused.
Useful, healthy review metrics
[BEGINNER]
- Time-to-first-review — how long a PR waits before receiving any feedback at all. A rising trend signals a capacity problem (Chapter 11's reviewer fatigue) worth addressing systemically.
- PR size distribution — tracking whether PRs are trending larger over time (a leading indicator of degrading review quality, per the companion Coding Standards book's Chapter 8 size-vs-thoroughness relationship).
- Review comment volume relative to PR size — a very low comment count on large, complex PRs can be a rubber-stamping signal (Chapter 11) worth investigating at the team level, in aggregate, not as an individual reviewer's report card.
- Post-merge defect rate by area of the codebase — areas with disproportionately more post-merge bugs might indicate a review gap specific to that area (perhaps it needs a specialized checklist, per Chapter 5, or more consistent domain-expert review coverage).
The critical distinction: team health signal vs. individual performance weapon
[SENIOR INSIGHT] Every metric above is genuinely useful when tracked in aggregate, at the team or codebase level, to identify systemic issues worth addressing (capacity problems, degrading PR size trends, review-coverage gaps). The exact same metrics become actively harmful the moment they're used to individually rank, evaluate, or pressure specific engineers — "Reviewer X leaves the fewest comments per PR" as an individual performance metric creates a perverse incentive to leave more comments regardless of whether they're actually needed, or conversely punishes a reviewer whose PRs simply happened to be well-written and needed little feedback. "Author Y's PRs take the longest to get approved" might reflect that Y works on the most inherently complex, highest-risk part of the codebase, not that Y writes worse code than colleagues working on simpler areas.
Healthy use: "Time-to-first-review has crept up from 4 hours to 2 days
over the last quarter across the team — let's investigate whether we
need to redistribute review load or reduce average PR size."
Harmful use: "Sarah's average review comment count is 40% below the team
average — this needs to be addressed in her next performance review."
(This conflates a proxy metric with actual review quality, and creates
exactly the perverse "leave more comments regardless of necessity"
incentive described above.)
Why individual metrics specifically backfire
[IN PRACTICE] The moment engineers know a specific individual metric is being tracked and evaluated, they will (rationally, if not always consciously) optimize for the metric rather than the underlying goal it was meant to proxy for — a well-documented general phenomenon (sometimes called Goodhart's Law: "when a measure becomes a target, it ceases to be a good measure"), and code review metrics are a particularly clear illustration of it. Tracking individual comment counts produces more comments, not necessarily better reviews. Tracking individual review speed produces faster reviews, not necessarily more thorough ones — potentially directly encouraging the rubber-stamping anti-pattern this book has already covered as a problem to avoid, not a goal to optimize toward.
Using metrics to start conversations, not end them
[SENIOR INSIGHT] The healthiest way to use review metrics: as a prompt for a genuine team conversation about process, not as a verdict delivered unilaterally. "Our average PR size has grown 3x this year — what's driving that, and is it a problem worth addressing?" invites the team's own insight into root causes (maybe a specific type of work genuinely doesn't decompose well; maybe habits have simply drifted) — a much more productive framing than a manager unilaterally declaring "PRs must be under 300 lines" without understanding why they've grown in the first place.
Common mistakes
- Tracking individual-level review metrics (comment count, review speed) and using them in performance evaluations — this reliably produces Goodhart's Law-style gaming rather than genuine improvement, and can directly incentivize the exact anti-patterns (rubber-stamping, comment-padding) this book has covered as problems.
- Treating a metric as a verdict rather than a starting point for investigation — a rising time-to-first-review number should prompt a "why, and what should we do" conversation, not an immediate, unexamined mandate.
- Comparing metrics across engineers working on genuinely different kinds of code (a complex, high-risk area vs. a simple, well-trodden one) as if the comparison were fair or meaningful.
- Not tracking any review metrics at all, missing the chance to catch systemic problems (a capacity issue, a coverage gap) before they cause a real incident.
Checklist: measuring review health responsibly
- Track review metrics in aggregate, at the team/codebase level, to identify systemic trends and gaps — capacity issues, PR-size drift, coverage gaps by area.
- Never use individual-level review metrics (comment count, review speed) in performance evaluation — this reliably produces gaming rather than genuine quality improvement.
- Treat a concerning metric trend as the start of a conversation ("why is this happening, and what should we do?"), not an immediately-imposed, unilateral mandate.
- Be skeptical of comparing metrics across engineers or teams working on genuinely different kinds of code, since the underlying work's complexity and risk profile aren't controlled for by a raw number.
Discussion / interview questions
-
"What review metrics would you track to assess your team's review health?" Strong answer: Time-to-first-review, PR size distribution over time, comment volume relative to PR size/complexity, and post-merge defect rate by codebase area — tracked in aggregate to spot systemic trends, not as individual performance indicators.
-
"Why is it risky to use individual engineers' review comment counts as a performance metric?" Strong answer: Engineers will rationally optimize for the metric rather than the underlying goal (Goodhart's Law) — producing more comments regardless of whether they're actually needed, or punishing a reviewer whose assigned PRs simply needed little feedback; the metric stops reflecting genuine review quality the moment it's used as an evaluative target.
-
"Your team's average PR size has tripled over the past year. How would you approach this as a lead, versus just mandating a size limit?" Strong answer: Use the metric to start an investigative conversation with the team about root causes (has the nature of the work changed, have habits simply drifted) before imposing a unilateral mandate — understanding the cause first leads to a more effective, better-accepted fix than an arbitrary top-down rule.
-
"Is it fair to compare 'time to approval' across two engineers working on different parts of a codebase?" Strong answer: Not necessarily — one engineer might work on a more inherently complex, higher-risk area that warrants slower, more careful review, and the raw comparison doesn't control for that difference in underlying work; a fair comparison would need to account for the nature of the work, not just the raw metric.
Chapter summary / cheat sheet
- Useful aggregate metrics: time-to-first-review, PR size distribution, comment volume relative to PR complexity, post-merge defect rate by area — tracked at the team/codebase level to spot systemic issues.
- Individual-level review metrics used in performance evaluation reliably backfire (Goodhart's Law), incentivizing gaming the metric rather than genuinely improving review quality — and can directly encourage anti-patterns like rubber-stamping or comment-padding.
- Use metrics to start genuine team conversations about root causes, not as unilaterally-imposed verdicts or mandates.
- Be skeptical of comparing raw metrics across engineers or teams working on genuinely different, uncontrolled-for kinds of work.