CodeGraph/docs
Section 6.2

Cycle Health (28%)

Evaluates the proportion of files and symbols entangled in circular dependencies, capping maximum risk at 10% cyclic node participation.

Source: server/src/analytics/health/cycles/calculateCycleHealth.ts

Mathematical Formulation

Cycle health calculates the proportion of files and symbols that participate in any discovered SCC:

Mathematical Definition
1
2
3
4
5
6
7
8
fileCycleRatio = cyclicFiles.size / totalFiles; symbolCycleRatio = cyclicSymbols.size / totalSymbols; cycleRatio = (fileCycleRatio + symbolCycleRatio) / 2; // 10% participation represents maximum structural risk: normalizedRisk = Math.min(cycleRatio / 0.10, 1.0); score = 100 * (1 - normalizedRisk);

Why Cycles Carry 28% Weight

Circular dependencies are the single highest weighted metric (28%) because cycles break topological orderings, introduce undefined variable imports at module evaluation time, and force tightly coupled refactorings across files.