Expand description
Change coupling and change dispersion from the commits of the churn pass.
Change dispersion is the number of files and lines in the commits that touch a file. Change coupling is a pair of files that change together in many commits. A coupled pair is hidden when no static edge (an import or a re-export chain) connects the two files, so an agent that reads the import graph cannot find the second file.
The thresholds follow the Code Maat defaults: a file needs 5 revisions, a pair needs 5 shared revisions and a coupling degree of at least 30%, and a commit that touches more than 30 files is a bulk commit and is skipped.
Structs§
- Change
Coupling Settings - Thresholds for change coupling.
- Change
History Analysis - Result of one pass over the commit history.
- CoChange
Gap - A changed file whose hidden change-coupling partner is not in the change.
- CoChange
Pair - A pair of files that change together.
path_asorts beforepath_b. - File
Dispersion - Change dispersion of one file.
- Pair
Scope - Scope filters for hidden pairs:
health.ignore, the workspace filter, and an optional diff. - Static
Link Index - Static edges between analyzed files, for the hidden-pair check.
Constants§
- DEFAULT_
MAX_ FILES_ PER_ COMMIT - Default maximum number of analyzed files in one commit. A larger commit is a bulk change (a rename, a format pass, a dependency bump) and creates pairs that are not real coupling.
- DEFAULT_
MIN_ DEGREE - Default minimum coupling degree, as a ratio in
[0, 1]. - DEFAULT_
MIN_ REVISIONS - Default minimum number of commits for each file of a pair.
- DEFAULT_
MIN_ SHARED_ REVISIONS - Default minimum number of commits that change both files of a pair.
- STRONG_
COUPLING_ DEGREE - Coupling degree at or above which a hidden pair is strong. A strong pair becomes a refactoring target.
Functions§
- analyze_
change_ history - Analyze change dispersion and hidden change coupling over
commits. - co_
change_ gaps - Hidden pairs with exactly one file in
changed. Sorted by degree and then shared revisions (both descending), then by changed file and partner, so a cap keeps the strongest gaps. - health_
ignore_ set - Compile the
health.ignoreglobs thatPairScopeapplies.