Git Coupled Files is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Git Coupled Files
API ID: GitCoupledFilesLanguages: Any
Targets: Files
The number of coupled files
A file is coupled to another file through Git if they are both modified in the same commit. The coupling is measured by the number of commits the two files co-occur in divided by the number of commits for the target file. Files that frequently change together, especially without dependencies, can indicate design flaws.
To reduce the noise in the metrics, two thresholds are imposed. A pair of files is coupled only if the number of shared commits is greater than 5 and is greater than 10% of the total commits of the target file.
This metric is part of a set of related metrics to measure coupling:
- Git Max Coupling (GitMaxCoupling)
- Git Average Coupling (GitAvgCoupling)
- Git Coupled Files (GitCoupledFiles)
- Git Strongly Coupled Files (GitStrongCoupledFiles)
See also the Git Solution, the blog article ↗ describing the Git plugins, and the interactive report Git Coupling. Also related is the architecture metric Git Cohesion .