Skip to content

Rank the places under a remedial action by how widely used and how busy they are - #45

Merged
joshsiaw merged 1 commit into
mainfrom
cato/rank-places-by-graph
Oct 19, 2026
Merged

joshsiaw merged 1 commit into
mainfrom
cato/rank-places-by-graph

Conversation

@joshsiaw

Copy link
Copy Markdown
Contributor

Complex functions and untested files were listed in scanner order, so the top of each list was arbitrary — often abandoned code or boilerplate.

What changes

  • The boundaries scan also writes hotspots.json: for each source file, how many non-test files import it (from the code graph it already builds) and how many commits touched it in its existing 90-day window. Files that define nothing, such as barrels of re-exports, get no credit for being imported.
  • Complexity findings and untested files are sorted by (used by + 1) × (changes + 1).
  • The complexity and test-breadth actions end with Start with the most used and most changed: a, b, c.
  • Where C1 does not trust the graph (Elixir), only change counts are used, and the sentence says the most changed.
  • The test-coverage scan keeps every untested file instead of the first 20, so ranking happens before anything is cut.

What does not change
No score reads the ranking. Replayed on one TypeScript and one Elixir system: every score, colour and finding is identical apart from order and the new sentence, and boundaries.json is byte-identical to main. Without hotspots.json (older reports), output is unchanged.

Tests: 601 pass. Planted violations confirmed the ranking, the start-with line and the Elixir fallback are each guarded.

Known limit: generated source files (e.g. an API client generated from a spec) can rank high because they change often; the graph cannot tell them apart.

🤖 Generated with Claude Code

…sy they are

Complex functions and untested files were listed in scanner order, so the
start of each list was arbitrary. The boundaries scan now also writes
hotspots.json: for each source file, how many non-test files import it
(from the code graph it already builds) and how many commits touched it in
the 90-day window it already reads. Files that define nothing, such as
barrels of re-exports, get no credit for being imported.

The findings lists are sorted by (used by + 1) x (changes + 1), and the
complexity and test-breadth actions end with the top three files. Where
C1 does not trust the graph (Elixir), only change counts are used, and
the action says so. The test-coverage scan now keeps every untested file
rather than the first 20, so ranking happens before anything is cut.

No score reads the ranking. Replayed on two real systems, every score,
colour and finding is unchanged apart from order and the new sentence,
and boundaries.json is byte-identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@joshsiaw

Copy link
Copy Markdown
Contributor Author

@maciej-szlosarczyk quite honestly I don't understand completely what's been done on the code level in this one. There a LOT of scripting and I just directed it based on what was required which as you can see in the description was actually simple in concept.

@maciej-szlosarczyk

Copy link
Copy Markdown
Contributor

@joshsiaw I think it's fine, one thing I missed is adding a binary annotation to files in dist folder so that the generated files are collapsed in review. Fixed it here: #46

@joshsiaw
joshsiaw added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 109007b Oct 19, 2026
5 checks passed
@joshsiaw
joshsiaw deleted the cato/rank-places-by-graph branch October 19, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants