CodeGraph/docs
Section 6.3

Coupling Health (23%)

Evaluates total interconnectedness across all files and symbols, applying reciprocal normalization to penalize high average structural degree.

Source: server/src/analytics/health/coupling/calculateCouplingHealth.ts

Mathematical Formulation

Coupling health sums both incoming and outgoing edges for every file and symbol node:

Mathematical Definition
1
2
3
4
5
6
7
totalDegree = sum(fanIn + fanOut) for all files & symbols; averageStructuralDegree = totalDegree / (totalFiles + totalSymbols); // Calibration constant k = 0.5 normalizedRisk = 0.5 * averageStructuralDegree; score = 100 / (1 + normalizedRisk);