KPI Tree

Metric Definition

Code repository condition index

Repository Health Score = Sum of (Component Score x Component Weight) for all components
Component ScoreA normalised 0 to 100 score for one health dimension such as test coverage, dependency freshness, or review discipline
Component WeightThe fraction of the total score assigned to that component, with all weights summing to 1

Track from

Metric GlossaryOperations Metrics

Repository health score

Repository health score is a composite index that grades a code repository on how maintainable, secure, and actively cared-for it is, usually expressed from 0 to 100. It rolls up signals such as test coverage, dependency freshness, open issue age, and review discipline into a single number teams can track over time. It turns the diffuse idea of code quality into something you can baseline, compare across repositories, and hold an owner accountable for.

7 min read

Generate AI summary

What is repository health score?

Repository health score is a weighted composite that combines several quality and maintenance signals into a single 0 to 100 grade for a code repository. A repository with strong test coverage, up-to-date dependencies, fast review turnaround, and few stale issues scores high. One with failing tests, abandoned pull requests, and security alerts left open scores low. The number is a summary, not a measurement of one thing.

It matters because code quality is otherwise invisible until it causes an incident. A repository can look fine on the surface while accumulating outdated dependencies, untested paths, and a backlog of unreviewed changes. The health score surfaces that decay early, before it turns into a security breach, a failed deploy, or a feature that takes three times as long to ship as it should.

The score is most useful as a trend, not an absolute. A single repository at 72 tells you little. The same repository sliding from 85 to 72 over a quarter tells you maintenance is being deferred, and a portfolio view across dozens of repositories tells you where engineering time is most at risk. It complements delivery metrics like deployment frequency by explaining whether speed is being bought at the cost of accumulating risk.

There is no universal definition of the components or their weights. One organisation might weight security alerts heavily because it operates under strict compliance, while another weights documentation and onboarding signals because it relies on many contributors. The score is only meaningful when the rubric is written down and applied consistently across every repository being compared.

Because it is a composite, the headline number can hide as much as it reveals. A repository can hold a respectable score while one critical dimension, say security, is quietly failing, because strong scores elsewhere mask it. This is exactly why the score should always be read together with its components rather than on its own.

A composite score is only as honest as its weights. Decide and document what each component is worth before you compute the number, and keep the rubric identical across repositories. Re-weighting the formula to make a struggling repository look healthier defeats the purpose of having a score at all.

How to calculate repository health score

Pick the dimensions that represent health for your context, normalise each to a 0 to 100 scale, assign a weight to each so the weights sum to 1, then take the weighted sum. The result is the repository health score. The art is in choosing components that are both meaningful and measurable from data you already collect in version control and CI.

The inputs below are a common starting set. Adapt the list and the weights to your engineering standards, but write them down so the score stays comparable as the team and the codebase change.

  1. 1

    Select health components

    Choose the dimensions that define a healthy repository for you, such as test coverage, dependency freshness, security alert backlog, review discipline, build pass rate, and documentation completeness.

  2. 2

    Normalise each component to 0 to 100

    Convert each raw signal to a common scale. For example, map test coverage directly, and convert the count of overdue security alerts into a score where zero alerts is 100 and a defined threshold is 0.

  3. 3

    Assign weights that sum to 1

    Decide how much each component contributes. Security and test coverage often carry more weight than documentation. The weights encode your engineering priorities and must total 1.

  4. 4

    Take the weighted sum

    Multiply each normalised component score by its weight and add them together. The result is a single 0 to 100 figure you can track per repository and roll up across a portfolio.

Repository health score in a metric tree

A composite score is the natural top of a metric tree, because it is built from components by definition. Each component becomes a first-level driver, and each driver decomposes into the concrete signals an engineer can change. This makes the score diagnostic rather than merely descriptive: a low number always traces to a specific branch.

Metric tree insight

The headline score answers whether a repository is healthy. The tree answers why and who should act. If the score drops because the security branch is bleeding open alerts, that is a different owner and a different remedy than if review turnaround has stalled. KPI Tree puts a RACI owner on each branch and pushes to the accountable engineer when their component moves, so the score stops being a passive dashboard tile and starts triggering action.

Repository health score benchmarks

Because the rubric is bespoke, cross-organisation benchmarks should be treated as rough guidance rather than targets. What matters most is the band a repository sits in and the direction it is moving. The ranges below describe how to read a 0 to 100 score once your weights are fixed and applied consistently.

BandScore rangeWhat it usually means
Healthy85 to 100Well maintained, low risk, safe to build on and onboard into
Acceptable70 to 84Generally sound with a few neglected components worth scheduling
At risk50 to 69Visible decay in one or more dimensions, plan remediation soon
CriticalUnder 50Material risk to delivery or security, treat as a priority to fix

A high overall score does not clear a critical component. Set minimum floors on the dimensions that carry real risk, such as zero overdue security alerts, so a repository cannot reach the healthy band while one essential signal is failing underneath a strong average.

How to improve repository health score

Improving the score means raising the weakest weighted components, not polishing the ones already strong. Read the tree, find the branch dragging the number down, and direct effort there. The cards below cover the moves that most often shift a struggling repository back into a healthy band.

Clear the security and dependency backlog

Outdated dependencies and stale security alerts carry the heaviest weight in most rubrics. Automate update pull requests and set a service level for closing alerts so this branch stays near the top of its scale.

Raise meaningful test coverage

Add tests to the paths that actually fail, not just to lift a percentage. Reducing flaky tests and keeping CI green improves both the coverage component and the confidence to ship.

Tighten review turnaround

Stale pull requests and slow reviews drag the maintenance component down and slow delivery. Set review expectations and clear the open pull request backlog so changes do not rot in the queue.

Keep documentation current

A complete README, setup guide, and architecture notes lift the onboarding component and cut the cost of every new contributor. Treat docs as part of done, not an afterthought.

Common mistakes when tracking repository health score

  1. 1

    Re-weighting to flatter a repository

    Adjusting the weights so a struggling repository scores well turns the metric into theatre. Fix the rubric once and let the number tell the truth.

  2. 2

    Reading the headline without the components

    A strong average can hide a failing security component. Always inspect the branches before concluding a repository is healthy.

  3. 3

    Treating the score as a leaderboard

    Ranking teams on a composite encourages gaming the easiest components rather than fixing real risk. Use the score to guide work, not to score people.

  4. 4

    Ignoring the trend

    A static snapshot misses the story. A repository sliding from 85 to 70 needs attention even though it still looks acceptable in absolute terms.

Related metrics

Deployment Frequency

DORA metric

Operations Metrics
GitHub

Metric Definition

Deployment Frequency = Number of Production Deployments / Time Period

Deployment frequency measures how often an organisation successfully releases code to production. It is one of the four DORA (DevOps Research and Assessment) metrics that predict software delivery performance and organisational outcomes. Teams that deploy more frequently deliver value to users faster, reduce the risk of each individual release, and create tighter feedback loops between development and production.

View metric

Cycle Time

Process speed

Operations Metrics
Jira

Metric Definition

Cycle Time = Process End Time − Process Start Time

Cycle time measures the total elapsed time from the start to the end of a process. It is a fundamental operations metric used in manufacturing, software development, service delivery, and any context where the speed of a process directly affects throughput, cost, and customer satisfaction.

View metric

Sprint Velocity

Agile planning metric

Operations Metrics
Jira

Metric Definition

Sprint Velocity = Sum of Story Points Completed in a Sprint

Sprint velocity measures the amount of work a team completes during a sprint, typically expressed in story points, ideal days, or another unit of estimation. It is a planning tool that helps agile teams forecast how much work they can commit to in future sprints based on their historical completion rate. Velocity is one of the most widely used and most frequently misunderstood metrics in agile software development.

View metric

Escalation Rate

Customer Support Metrics
Pylon

Metric Definition

Escalation Rate = (Escalated Tickets / Total Tickets Handled) x 100

Escalation rate measures the percentage of support tickets that are transferred from one tier or team to a higher tier or specialist group for resolution. It reflects the gap between the issues customers raise and the ability of frontline agents to resolve them, making it a key indicator of agent readiness, process maturity, and product complexity.

View metric

Metric decomposition

Metric Definition

A repository health score is a composite index, so this guide shows you how to break it into the underlying signals that actually move it.

View metric

Metric trees for engineering teams

Metric Definition

This guide places a repository health score within the wider set of metrics engineering teams track and act on.

View metric

Make repository health a tree, not a dashboard tile

Model repository health score in KPI Tree with coverage, security, maintenance, and documentation on separate branches. Assign a RACI owner to each component so a falling score pushes to the engineer accountable for it, and the verified impact loop confirms the fix actually moved the number.

Experience That Matters

Built by a team that's been in your shoes

Our team brings deep experience from leading Data, Growth and People teams at some of the fastest growing scaleups in Europe through to IPO and beyond. We've faced the same challenges you're facing now.

Checkout.com
Planet
UK Government
Travelex
BT
Sainsbury's
Goldman Sachs
Dojo
Redpin
Farfetch
Just Eat for Business