Skip to main content

Module bus_factor

Module bus_factor 

Expand description

bus-factor analysis.

Computes per-module (per directory or per group-file group) bus factor: the minimum number of authors whose departure would leave the module unmaintained.

§Modes

--knowledge-model commits (default): Filatov 2010 — the smallest set of contributors whose combined commit count covers ≥ 80% of the module’s total commits.

--knowledge-model doe: Cury & Avelino SBES’24 truck-factor procedure — repeatedly remove the author who is DOE-expert on the most remaining files, stopping when >50% of files have zero remaining experts. The removed count is the bus factor. Requires doe_scores to be materialized (calls materialize_knowledge_shares first).

§Where the module boundary comes from

Default: the top-level directory of each file path (e.g. src/foo/bar.rs → module src). When --group-file is set, the ingest’s apply_grouping pass has already rewritten the changes.path column to group names — the analysis just rolls up per path which is now group-shaped. This is the intended interaction: --group-file defines architectural modules; the bus-factor analysis answers “what’s the risk per architectural module?”.

§CodeScene parity-and-better

CodeScene’s “Key Personnel” widget computes file-level bus factor. This analysis lifts it to module-level, which is what tech-leads actually care about — per-file is too granular to act on. Bus factor = 1 module = a clear “who else needs to learn this?” answer.

Structs§

BusFactorRow

Functions§

run_bus_factor
Run the bus-factor analysis.