Skip to content

Risk ​

This lens answers: which files still being worked on are risky on several counts at once? A busy file is usually just active, and a file with one author usually just has one author. A file that's busy, has one author and keeps needing fixes is a different thing. Each warning sign adds points, and a file reaching 50 is called cursed. The sidebar and the --json report use that name for the whole analysis: Cursed Files.

Its biggest limit is that the score is warning signs added up, not a measurement. It hasn't been shown that a higher score predicts more fixes later. Use it to choose which files to read first, and read them before concluding anything.

It only rates source code that changed recently, so a short list doesn't always mean a healthy repository. The lens says what it left out.

Reading the numbers ​

What you seeWhat it means
A score, such as 85The points a file's warning signs add up to, capped at 100. Each sign's points rise with how strong it is, so a score can be any whole number. See the point table.
Cursed at 50The line. No single sign is worth more than 35, so a file needs at least two to reach it.
Near missA file scoring 40 to 49. The 20 closest are listed. A file under 40 isn't listed at all.
"1 cursed file; the worst is invoice.go at 85."The headline when one file is cursed, or when the cursed files share no reason.
"3 cursed files; cart.tsx and checkout.tsx tie for the worst at 52."The same headline when the top score is a tie. It names no single worst file. Ties are uncommon, because points rise gradually with each sign.
"All 4 cursed files score on churn, many authors and parallel edits."The headline when the cursed files share reasons, naming the ones every file has. They may share a cause, so one change may help them all.
"1 file just misses the line at 50: ReportTable.tsx. The closest scores on churn and many authors, 9 points short."The near misses, the top ones named, and what the closest one has.
"ReportTable.tsx is a top hotspot (100) just under the line: its size isn't in this score."A near miss scoring 50 or more on Hotspots. This score ignores size, so it can undersell a big file.
"types.ts changes with 4 risky files: flags.* (2), cart.tsx and 1 more. No other source file reaches as many."The top file in Root causes, when it reaches two or more risky files or families. It keeps changing with them, which doesn't prove it causes anything. flags.* (2) is a family of two files drawn as one.
"Not rated: 1 test or generated file, 2 prose or data files and 1 file no one changed in 180+ days."Candidates left out by the rules below, always the last finding. These are only files that reached the candidate lists, not every test or Markdown file in the repository. Fixtures and snapshots count under "test or generated".
"Not rated: 1 file changed mostly by bots (deps.props)."A candidate left out because bots made most of its commits, named so a file you expected isn't simply missing. Up to three are named, then "and 2 more".
"Modified in 19% of all commits" on a 35-point segmentThe text and the points use different numbers. The points come from the churn score, which compares the file with the busiest file this lens rates. The 19% is its share of all commits, bots included.
"Single author owns 90% of changes"Also shown when other people made the other 10%. It's the top author's share, not proof of one author. At 90% it earns 24 points; only a file with one author earns the full 30.
"No file scores 40 or more", "Healthy repos show none"Files were rated and none added up to much. This can be good news. Read any "Not rated" line after it before deciding.
"5 of 7 files have 8+ commits; widen the window (--since all) for more."Of the candidates, how many reached the commit floor, whether or not they were then rated. The nudge doesn't appear when you're already analyzing all of history.
"No file was rated"Every candidate with enough commits was left out by a rule, so this says nothing about whether those files are healthy, and the picture doesn't say "healthy".
"No file has the 8+ commits a verdict needs", "3 candidates fell under it"No candidate reached the commit floor, so nothing could be judged, usually because the repository is young or the period is short.
"Not in the score: hotspot 100 · accelerating"Two signals beside the bar that add no points: a Hotspots score of 50 or more, and a Trend of accelerating.
"105 before the cap at 100"A tooltip on a file whose points add up past 100. Its bar runs past 100 and its score stops there.

Four example repositories ​

These repositories are invented, but each result is what GitRelic reports for commits like these.

A Go service with one person's billing file ​

1 cursed file; the worst is invoice.go at 85.

1 file just misses the line at 50: router.go. The closest scores on churn, many authors and parallel edits, 5 points short.

router.go is a top hotspot (51) just under the line: its size isn't in this score.

Not rated: 1 test or generated file, 2 prose or data files and 1 file no one changed in 180+ days.

FileScoreChurnOwnership / authorsFixesParallelHotspotStatus
internal/billing/invoice.go85353020077cursed
internal/api/router.go45221001351near miss (5 short)

What it means: invoice.go has three separate problems, each at the top of its range. It's the busiest file this lens rates, at 42 commits, all of them by one person, and 9 of its 39 changes needed a fix within 30 days, nearly five times the repository's rate of about 5%. Its tooltip says "Modified in 19% of all commits" beside 35 points, because being the busiest rated file is what earns them, whatever share of all commits that is.

invoice_test.go is busier, with 60 commits, but a test doesn't set the scale here, so invoice.go still scores 100 on churn. Churn itself compares it with the test and gives it 70.

router.go is a different kind of risk: 8 people, and 10 weeks when two of them worked in it at the same time. Its 26 commits are a churn score of 62, which earns 22 points, and its parallel score of 63 earns 13. Each sits partway along its range, which is why they add up to 45 rather than to a round number.

The last line accounts for invoice_test.go, README.md, deploy/values.yaml and internal/legacy/export.go. Each has 8 or more commits by one person, which is what put it on the candidate lists, and the last one is unrated because it stopped changing 223 days before the analyzed commit. The go.sum that changed 40 times isn't in that line: plumbing never reaches this lens.

What to look at: invoice.go. Open Fix rate, which names the changes those fixes repaired, and get a second person working in the file. Root causes has nothing to add here: it says "No source file changes with them often".

A TypeScript app with four files two points apart ​

All 4 cursed files score on churn, many authors and parallel edits.

1 file just misses the line at 50: ReportTable.tsx. The closest scores on churn and many authors, 9 points short.

ReportTable.tsx is a top hotspot (100) just under the line: its size isn't in this score.

types.ts changes with 4 risky files: flags.* (2), cart.tsx and 1 more. No other source file reaches as many.

FileScoreChurnOwnership / authorsFixesParallelHotspotStatus
src/routes/checkout.tsx542910015cursed
src/flags/flags.mobile.ts53331001056cursed
src/flags/flags.web.ts53331001056cursed
src/routes/cart.tsx5235100760cursed
src/ui/ReportTable.tsx41311000100near miss (9 short)

What it means: four files within two points of each other, with the same three reasons, and their order isn't a ranking. cart.tsx is the busiest, with 36 commits, and comes last. checkout.tsx has the fewest, 30, and comes first, because two people worked in it at the same time in 12 weeks, against 8 for cart.tsx. A two-point gap is a detail of that size. None of the four has a fix commit against it: they're busy files 8 people share, which may be perfectly fine.

The two flags files tie at 53. They change in the same commits, so every sign is the same for both. That's the usual way a tie happens.

The file with the largest cost may be the near miss. ReportTable.tsx has 2,432 lines and is 100 on Hotspots, while the four above it have 60 to 66 lines each and score 49 to 60 there. Which list matters depends on your question.

In Root causes, the two flags files are one family, because they change together in nearly every commit. types.ts isn't risky itself: its 12 commits are a churn score of 33, which earns nothing, and its one author's 30 points leave it under 40. Its tooltip reads "Changes with 4 risky files", then a line such as "cart.tsx · 4 of its 12 commits" for each file or family it reaches.

What to look at: don't try to rank the four. Read types.ts first, since all of them keep changing with it, then decide whether those shared changes are one problem.

A Python library in maintenance ​

Not rated: 2 test or generated files, 2 prose or data files and 5 files no one changed in 180+ days.

The picture says "No file was rated" and repeats that line, without the usual "healthy" sentence.

What it means: nothing here was judged. One person maintains the library, so every file with 8 or more commits has one author, and that's what put these nine on the candidate lists. Its five source files have 12 or more commits each, and the newest of them stopped changing nearly seven months ago. Since then, the commits have touched only tests, docs/guide.md, data/grammar.json and pyproject.toml, which is plumbing.

This doesn't say the code is safe or unsafe. Risk is about code still being worked on, and this code isn't. --since all won't change the result, because the 180 days are counted from the analyzed commit whatever the period.

What to look at: Age for how much has gone cold and whether anyone who knows it is left, and Ownership for who would need to pick it up.

A Ruby gem with a one-line file ​

1 cursed file; the worst is version.rb at 65.

FileScoreChurnOwnership / authorsFixesParallelHotspotStatus
lib/acme/version.rb65353000cursed

What it means: this is a false alarm, and the kind this score can produce. version.rb has one line and 26 commits, all by the person who cuts releases. It's the busiest file this lens rates and it has one author, so it earns the top points for both, 65 in all, and the Cursed 60+ tier. On Hotspots the same file scores 0, because size counts there and its size is one line. In this table, a blank Hotspot cell means under 50.

The opposite holds too. lib/acme/client.rb has 909 lines and 10 commits by 4 people. It's 100 on Hotspots and has no row here: its churn score of 38 earns nothing, and four people with nobody at 75% earn nothing either.

What to look at: open the file. A score says a pattern is there, not what the file is. A version bump has nothing to fix, so you can ignore this row. If a release bot did the bumping, the file would be left out rather than listed.

How it's measured ​

Risk reads no git history of its own. It combines what Churn, Ownership, Fix rate, Parallel Dev and Age measured.

Which files get rated ​

Candidates. A file on none of the four lists is never considered, however it would score. The most-changed list holds only files the rules below let through, so busy tests, data files, files mostly changed by bots and quiet files don't take its places. The other three lists can still bring those in, and they're then counted under "Not rated". Files mostly changed by bots are counted there too when they're busy enough for the most-changed list. So that line names files with one owner, frequent fixes or a lot of work at once that the rules left out, not every busy test.

The floor. A candidate needs 8 or more commits in the analyzed period, counted as Churn counts them: by people and AI agents, with bots left out. One commit says who changed a file, not who owns it or how often it breaks. The period is the last 12 months by default.

Source files only. Tests are never rated. Fixtures, snapshots and generated code aren't either, unless you run with --include-fixtures, which brings those back and leaves tests out. So "test or generated" can mean a snapshot or a vendor/ file.

Project plumbing never reaches this lens and isn't counted in "Not rated": manifests, lockfiles, changelogs, licenses, and CI and tool configuration, such as package.json, go.mod, MODULE.bazel, project.pbxproj, *.podspec, Directory.Packages.props and .pullapprove.yml. --include-fixtures doesn't bring it back. See what Churn leaves out.

Prose and data are left out by extension: .md, .mdx, .rst, .txt, .json, .yaml, .yml, .toml, .xml and .csv. A README can top every signal here, and none of them means what it means for code. CSS and HTML stay in, because people write those and they break.

Recent changes only. A person must have changed the file in the 180 days before the analyzed commit. Three things about that clock:

  • It counts back from the analyzed commit, not from today, so the last files touched in a repository that stopped two years ago still count as recent.
  • It reads all of history, whatever the period. Widening the period doesn't bring a quiet file back.
  • Only people reset it, AI agents included. A dependency bump to a file nobody has worked on in a year leaves it quiet, so Age, which counts every commit, can call the same file 5 days old. Any person's commit does reset it, including one reformatting the whole repository.

With a period shorter than 180 days this rule has nothing to do, because every candidate changed inside the period.

The point table ​

Each reason's points rise evenly with its signal: entry points where the reason starts, up to its top points at the signal's extreme, rounded to a whole number and held there beyond it. Each group adds one reason at most. Hover a segment to see its text, which holds the numbers behind it.

GroupLegend nameWhenPointsText, for example
ChurnChurnChurn score above 4015 just above 40, rising to 35 at 100"Frequently modified (26 commits)", or above 75, "Modified in 19% of all commits"
OwnershipOwnershipHigh or critical risk: the top author at 75% or more, or one author15 at 75%, rising to 30 at 100%"Heavily concentrated ownership (80% one author)", or at 90% or more, "Single author owns 100% of changes"
Many authorsNeither of those, with 6 or more authors10"8 different authors — high coordination overhead"
FixesFix commitsFixed more often than chance explains (Fix rate)10, rising to 20 at three times the repository's fix rate"9 of 39 changes needed a fix within 30 days, more than chance explains"
ParallelParallel editsParallel score 20 or more5 at 20, rising to 20 at 100"Some parallel development detected", from 40 "Notable parallel development activity", from 70 "Heavy parallel development — 10 weeks of concurrent multi-author work"

Between the two ends, points follow the number: a churn score of 70 earns 25, a top author at 90% earns 24, a file fixed twice as often as the repository earns 15, and a parallel score of 63 earns 13. The text changes in bands, but the bands only choose the words.

The most a file can add up to is 105 (35 + 30 + 20 + 20), and the score stops at 100.

Ownership counts at both ends. One person is a risk, and so are six or more with nobody at 75%. Two to five people with nobody at 75% earn nothing. A file shows Ownership or Many authors, never both: seven authors with one at 80% earns 18 for ownership and nothing for the crowd.

Ties are rare, and small gaps don't mean much. Because points follow each signal, scores spread out, and two files tie only when their signs match closely, such as two files that change in the same commits. Files with the same score are listed with the most commits first, then by path, which keeps the order stable but doesn't say which is riskier. A gap of a few points is no ranking either: a 52 and a 50 are a slightly busier file or a week more of parallel work apart.

The churn score ​

The churn score isn't a share of commits. It's a file's commits, by people, as a percentage of the busiest file this lens would rate:

  • If that file has 40 commits, a file with 31 scores 78 and earns 28, a file with 17 scores 43 and earns 16, and a file with 16 scores 40 and earns nothing.
  • The busiest rated file always scores 100, however few commits it has, so it earns the full 35.
  • A file can be in 19% of all commits and earn 35, or in 63% and earn the same. The text states that share, but it doesn't decide the points.

Only files the rules above let through set the scale. Tests, fixtures, generated code, prose, data, files mostly changed by bots and files no one changed in 180 days don't, and plumbing never reaches this lens. So a busy test doesn't lower any source file's churn points: in the Go example, invoice_test.go has 60 commits and invoice.go 42, and invoice.go still scores 100. That's why this score can differ from the one on Churn, which compares a file with the busiest file it counts, tests and prose included.

Files mostly changed by bots ​

A file is left out when more than half of its commits in the period are by bots, even if it's a source file with 12 commits by people. Commits by AI agents count as people's, not bots'. Its signs describe the bot's schedule, not people's work, so it isn't scored, doesn't set the churn scale and doesn't take a place on the most-changed list. It's counted and named in the "Not rated" line, whatever it would have scored.

For example, a .NET repository's Directory.Packages.props with 61 dependency-bot commits and 9 by its one maintainer reaches the candidates through its single owner, and the line reads "Not rated: 1 file changed mostly by bots (Directory.Packages.props)." When it's the only candidate, the picture says "No file was rated", not that the repository is healthy.

It's still a candidate when it would have ranked among the 20 most-changed files, counting only people's commits, but it doesn't take one of those places: the 20 most-changed files that are rated keep all of them.

In the dashboard ​

Find this lens under Code Health. It has two forms, switched by the toggle in the corner.

  • Score stacks is the main picture. Each row is a file: cursed files first, highest first, then the near misses on thinner bars under a "near misses, under 50" rule. Each bar is split by reason, with a legend above and the line at 50 drawn in. The column on the right, "Not in the score", holds signals that add no points. Hover a row for its reasons and points, or a segment for the text behind it. Click anywhere on a row to select the file.
  • Root causes (the corner toggle) has the same cursed files and near misses on the right, and on the left, up to 8 files that keep changing with them, called hubs. A ribbon's width is the commits they share, and a hub's tooltip gives counts such as "4 of its 12 commits". Hubs are ranked by how many risky files or families they reach, then by shared commits. A risky file no drawn hub reaches stays on the right, faint, marked "no hub". With no hubs at all, the left side says "No source file changes with them often".
  • Who can be a hub. A file outside the risky set that shares at least 3 commits with a risky file, making up at least 30% of the rarer file's commits, as Coupling counts them. Tests, fixtures, generated code and plumbing can't be hubs, and neither can prose or data (Markdown, plain text, JSON, YAML, TOML, XML, CSV and the like), the same formats Cursed Files doesn't rate. A README edited alongside risky code isn't what breaks it.
  • Families. Risky files sharing 75% or more of the busier file's commits, over 5 or more commits, are drawn as one node, such as flags.* (2). A hub reaching a family counts as one in its ranking and as every member in "4 risky files".
  • The inspector, with nothing selected, shows the count ("4 cursed files at 50+, 1 near miss"), the findings quoted above, and the five highest scores with small split bars. With nothing to report, it says "No file scores 40 or more in this window."
  • A selected file's card adds a Curse Score row when the file is cursed. A near miss has no such row: its score is in the stacks and the table.
  • The table (T) lists every cursed file and near miss, highest first: score, the points for each reason, the Hotspots score when it's 50 or more, and a status such as "near miss (5 short)". Its tiers are Near miss, Cursed and Cursed 60+. An Under 40 chip is there too, but no row can be in it.
  • Elsewhere. The lens gets a badge when any file is cursed, Overview shows the count, and Hotspots shows a selected file's place in Root causes.

"Not rated" appears as the last finding, and on the empty picture of either form. It's on every result where a rule left a candidate out, including a long list of cursed files.

Reports saved by an earlier version can look different. One may show a sixth reason, Abandoned, with its own legend entry and table column: GitRelic no longer awards it, and neither appears otherwise. One may have no "Not rated" line, or never mention files mostly changed by bots, or show a bar as one grey segment whose tooltip says "The split by reason isn't in this report". Run again to see current scores.

What it can't tell you ​

  • Whether a high score predicts trouble. It hasn't been shown that files scoring higher need more fixes later. Only the Fix commits reason looks at repairs at all, and it looks backward.
  • Which of two close files is worse. Ties are rare, but a few points mean little: a 52 and a 50 are near-equal, and files with the same score are only listed by commits, then path. See the point table.
  • Anything about size. A one-line file can be cursed while scoring 0 on Hotspots, and a huge file can be missing here while scoring 100 there.
  • Anything about code nobody is changing. A dangerous file everyone is afraid to touch is never rated once no one has changed it for 180 days, however often bots bump it. Age covers that.
  • Anything about tests, configuration or data. A YAML file can take a system down, and this lens won't mention it.
  • Whether the owner is still here. One author earns 30 points whether they're active or left a year ago. Ownership shows who's gone.
  • How one repository compares with another. The churn score is relative to each repository's own busiest rated file, while the line stays at 50. Small repositories and large ones land differently, so compare a repository with itself.
  • More than the lenses it reads. A commit message saying "fix" that isn't a fix, an author under two unmerged addresses, a release bot committing under a person's address: each of these feeds straight into the score. Check a file's card against its parts before acting.
  • The history of a renamed file. Commits under an old path don't count, so a renamed file can fall under the floor. See Renames.
  • Hotspots — files both busy and big. It counts size and ignores ownership and fixes, so it often disagrees with this lens, and a file on both lists is worth reading first.
  • Churn — the commit counts behind the churn score, and what counts as plumbing.
  • Ownership — file risk, behind the ownership points, and who has left.
  • Fix rate — which changes needed a fix, behind the fix points, and what "more than chance" means. Usually the most useful next stop, because it names the commits.
  • Parallel Dev — the parallel score, behind the parallel points.
  • Coupling — the file pairs Root causes is built from.
  • Age — every file's age, bots' commits included, and the cold code this lens doesn't rate.

Released under the MIT License.