Module main_dev
Expand description
main-dev / main-dev-by-revs / main-dev-by-deletions analyses.
Three variants of the same query shape — author-aggregation, top-by-metric, ownership ratio — switching only the metric column.
| Analysis | Metric | Code-maat name | Honest CSV headers |
|---|---|---|---|
main-dev | SUM(loc_added) | main-dev | entity,main-dev,added,total-added,ownership |
main-dev-by-revs | COUNT(*) | main-dev-by-revs | entity,main-dev,revisions,total-revisions,ownership |
main-dev-by-deletions | SUM(loc_deleted) | refactoring-main-dev | entity,main-dev,removed,total-removed,ownership |
§Modernization decisions
- Honest column headers: code-maat reused
added/total-addedformain-dev-by-revseven though the values are revision counts. We emitrevisions/total-revisionsinstead. Under--code-maat- compatthe legacy headers are restored. - Deterministic tiebreaks: when two authors tie on the metric, the
alphabetically-first author wins (
ORDER BY metric DESC, author ASC) instead of code-maat’s(first (reverse (sort-by metric-fn ...)))arbitrary pick. refactoring-main-devis an alias formain-dev-by-deletions. Code-maat’s name implies a refactor-commit-message filter that doesn’t exist (the analysis is just “main-dev with metric=deleted-lines”; the “refactoring” framing is Tornhill’s heuristic that removing code is a deliberate design choice). Both names dispatch to the same query.canonical_author(post-mailmap) is the grouping key, not rawauthor_email.
Research basis: see docs/research-foundations.md entry “main-dev”
(Mockus & Herbsleb, ICSE 2002 — expertise identification;
D’Ambros et al., Empirical Software Engineering 2010 — three-metric
decomposition; Tornhill, Your Code as a Crime Scene, 2015 — the
refactoring-main-dev heuristic).
Structs§
Enums§
- Main
DevMetric - Which metric drives the “main developer” ranking.
Functions§
- run_
main_ dev - Top author per file ranked by lines added. Code-maat parity.
- run_
main_ dev_ by_ deletions - Top author per file ranked by lines deleted. Code-maat ships this as
refactoring-main-dev(Tornhill’s heuristic that removing code is a deliberate design choice). The honest name ismain-dev-by-deletions;refactoring-main-devis an accepted alias. - run_
main_ dev_ by_ revs - Top author per file ranked by revision count. Code-maat parity.