Skip to main content

Module main_dev

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.

AnalysisMetricCode-maat nameHonest CSV headers
main-devSUM(loc_added)main-deventity,main-dev,added,total-added,ownership
main-dev-by-revsCOUNT(*)main-dev-by-revsentity,main-dev,revisions,total-revisions,ownership
main-dev-by-deletionsSUM(loc_deleted)refactoring-main-deventity,main-dev,removed,total-removed,ownership

§Modernization decisions

  • Honest column headers: code-maat reused added / total-added for main-dev-by-revs even though the values are revision counts. We emit revisions / total-revisions instead. Under --code-maat- compat the 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-dev is an alias for main-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 raw author_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§

MainDevRow

Enums§

MainDevMetric
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 is main-dev-by-deletions; refactoring-main-dev is an accepted alias.
run_main_dev_by_revs
Top author per file ranked by revision count. Code-maat parity.