68// 100%; multiplied by high test-file complexity that buries the real work.
69// Volume keeps the heavyweight couplings on top and matches --hotspots.
70▶func (c CouplingCount) WeightedScore() float64 {
71 return float64(c.Shared) * float64(min(c.ComplexityA, c.ComplexityB))
72}
· · ·
75// co-change first, then degree, then path. Shared by the raw sort and used as
76// the tiebreak under weighted ranking.
77▶func lessCouplingRaw(a, b CouplingCount) bool {
78 if a.Shared != b.Shared {
79 return a.Shared > b.Shared
· · ·
91// when the Cognitive global is on (matching --hotspots), cyclomatic otherwise.
92// A path absent from HEAD contributes zero, so it can never lift a pair's score.
93▶func headComplexity(head HeadSnapshot, path string) int64 {
94 hf, ok := head.Files[path]
95 if !ok {
· · ·
106// for the human-facing table only; the raw counts sit beside it so the number
107// is never a black box. Returns 0 when the union is empty.
108▶func (c CouplingCount) Degree() float64 {
109 union := c.CommitsA + c.CommitsB - c.Shared
110 if union <= 0 {
· · ·
140type pairKey struct{ a, b string }
141
142▶func newCouplingObserver() *couplingObserver {
143 return &couplingObserver{
144 maxFilesPerCommit: CouplingMaxFilesPerCommit,
+ 30 more matches in this file