Generate an overall health score for a Git repository from activity and quality signals.
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.
health_score = branch_hygiene × 0.25 + commit_frequency × 0.20 + pr_review_speed × 0.25 + test_coverage × 0.30
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.
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.
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.
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.