Git Repository Health Score Calculator
Generate an overall health score for a Git repository from activity and quality signals.
About Git Repository Health Score Calculator
Repository health blends four weighted signals into a single score: branch hygiene (25%, penalizing stale/long-lived branches), commit frequency (20%, activity level), PR review speed (25%, faster first-review turnaround scores higher), and test coverage (30%, the highest weight since it most directly predicts defect risk). Each sub-score is normalized to 0-100 before weighting.
Formula
health_score = branch_hygiene × 0.25 + commit_frequency × 0.20 + pr_review_speed × 0.25 + test_coverage × 0.30
- branch_hygiene
- clamp(100 - stale_branch_percent × 2, 0, 100)
- commit_frequency
- clamp(commits_per_week / 50 × 100, 0, 100)
- pr_review_speed
- clamp(100 - (avg_review_hours - 4) / 68 × 100, 0, 100)
- test_coverage
- Test coverage percentage (0-100)
Worked example
With the default values below, Git Repository Health Score Calculator returns Repository Health Score of 74.2. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Stale/Long-Lived Branchesaccepts 0–100 %
- 15 %
- Commits per Weekaccepts 0–1,000,000 /week
- 40 /week
- Avg PR Review Timeaccepts 0–100,000 hours
- 20 hours
- Test Coverageaccepts 0–100 %
- 72 %
Results
- Repository Health Score
- 74.2 /100
- Health Grade
- Good
- Branch Hygiene
- 70 /100
- Commit Frequency
- 80 /100
- PR Review Speed
- 76 /100
- Test Coverage
- 72 /100
Step by step
- 1Branch hygiene (25%)= 70
- 2Commit frequency (20%)= 80
- 3PR review speed (25%)= 76
- 4Test coverage (30%)= 72
- 5Weighted health score= 74.2
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax or fees or charges into account.
- Figures are rounded for display to 1 decimal place, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Why does test coverage get the highest weight?
Of the four signals, test coverage has the most direct empirical link to defect escape rate and safe refactoring — the other three describe workflow health, while coverage describes a safety net for the code itself.
Can a repository have high activity but low health?
Yes — high commit frequency with poor branch hygiene, slow reviews, or low test coverage will pull the composite score down; activity alone doesn't indicate a well-maintained repository.
How is the branch hygiene score calculated?
It penalizes the percentage of stale/long-lived branches at a rate of 2 points per percent, reaching zero once 50% or more of branches are stale — reflecting how quickly hygiene issues compound.
How often should I recompute this score?
Monthly is a reasonable cadence for most teams — frequent enough to catch trend shifts (e.g. coverage regressions, review time creep) without reacting to single-week noise.
Related Calculators
You might also need
- Contributor Activity CalculatorCommonly used together
- Release Frequency CalculatorCommonly used together
- Pull Request Review Time CalculatorCommonly used together
- Branch Lifetime CalculatorCommonly used together
- Code Churn CalculatorCommonly used together
- Commit Frequency CalculatorCommonly used together
