HealthScoreCalculator
Computes a 0–100 architecture health score for each module.
The score is a weighted composite of four signals:
| Signal | Weight | Rationale |
|---|---|---|
| Instability index | 30% | Measures how dependent vs depended-upon a module is |
| God module status | 25% | High fan-in AND fan-out = hard to change, hard to test |
| Cycle participation | 25% | Cycles prevent independent builds and refactoring |
| Transitive dep count | 20% | Proxy for hidden coupling and build-time impact |
A score of 100 means: stable, no coupling hotspot, not in any cycle, few transitive deps. A score below 40 is a strong signal that the module needs architectural attention.
projectScore computes a separate whole-project score from project-level signals (cycles, violations, coupling hubs, average instability). The two are deliberately different measures and are never interchangeable: a project of uniformly healthy modules can still score poorly if they are tangled together. Both are single-sourced here so the report, the CSV, and the docs cannot drift apart.
Both scores are intentionally non-configurable - their value comes from being a consistent signal across projects, not a team-specific threshold.
Functions
Returns the whole-project health score - a different measure from the per-module score.