Skip to main content

How to find the bus factor of a GitHub repository

Measure a GitHub repo’s bus factor and code ownership per directory, and find hotspot files. Free, no sign-in, any public repository.

What the bus factor measures

The bus factor is the number of people who would have to leave a project before knowledge of part of it goes with them. A bus factor of 1 means one person wrote most of that code; if they leave, nobody else knows it well.

It matters when you depend on an open-source project, take over a codebase, or plan who should review which areas.

How RepoLens calculates it

RepoLens counts each author’s changes to every file in the analyzed commits, then sums them per top-level directory. The bus factor of a directory is the smallest number of authors who together made more than half of its changes.

The Insights tab shows this for the whole repository and for each top-level directory, along with the number of authors, the top author, and that author’s share of the changes. A directory with a bus factor of 1 and a high top-author share is where knowledge is most concentrated.

Hotspots: where risk concentrates

Ownership tells you who knows the code; hotspots tell you which code matters most. RepoLens ranks files that are both changed often and large, since that is where bugs and painful changes tend to collect. Size is log-scaled so one huge file can’t dominate the list, and lockfiles and minified files are excluded.

A hotspot in a directory with a bus factor of 1 is the first place to add tests, documentation, or a second reviewer.

Limits to keep in mind

The numbers come from the most recent 500 commits on the default branch, so they describe recent ownership rather than the whole history. Authors are counted by the name on each commit, so someone who commits under several names is split into more than one author.

Try it on a repository