How your codebase is moving
From the Git history alone: how fast the code changes, where, which files to fix first, who it rests on, and how the work is done.
Before you start
- A Git repository open in WTFCode. No GitHub, no model.
Which commits are counted#
Open Insights in Code Review and choose Codebase. The strip names the branch and how many commits it counts. Pick 7d, 30d, 90d or All; the range is remembered and shared with Authors and Compare.
It counts every commit the checked-out branch reaches, by when it landed, in whole days on your clock. Merge commits are left out and the strip says how many. Renames are followed, so a file counts under the name it has today. A commit is read once ever and kept on your Mac, so the second look is instant.
Five questions#
| Section | Cards | A click opens |
|---|---|---|
| How is it moving? | Pulse: commits, authors, lines and files, with commits per day, week or month; Lines added and removed | The range in Code Review |
| Where does it change? | Map of change by folder; Hot spots; By area: files new, changed and deleted per module and layer | The file, or the module’s page |
| What to fix first? | Refactor quadrant; Hidden coupling: files that change together with no link in the code | The file |
| Who does it rest on? | Contributors; Ownership: authors per module and the top one’s share; Knowledge risk: areas only one person knows | The person’s Authors page |
| How is the work done? | Kind of work; Commit sizes; Tests with change; When; Code age | The module’s page |
Hot spots: where bugs and review time go#
A file that changes often, that many files depend on, and that is long is where a change is most likely to break something and most expensive to review. Hot spots ranks each code file of today’s map by:
changes in the range × (1 + files that depend on it) × lineswith each of the three shown, so you can see why a file is there. Only code files that still exist are ranked.
Ownership and knowledge risk#
Ownership counts commits, not lines: lines would hand an area to whoever imported or reformatted it. Areas only one person touches come first and are counted; Knowledge risk names them with the person, so you know what to pair on before they go on holiday.
Tests with change counts, per module, the commits that change code and a test together, least first. A test anywhere in the commit counts, beside the code or in a folder of its own.
Next steps#
Something unclear or out of date? Tell us; a person on the team reads every note.