Refactor: Architecture Hotspots
Find structural issues that create ongoing maintenance burden.
Hotspot Categories
- High-Churn Files
Files changed frequently indicate poor abstraction boundaries.
- Coupling Analysis
-
Afferent Coupling (Ca): Who depends on this?
-
Efferent Coupling (Ce): What does this depend on?
-
Instability (I): Ce / (Ca + Ce)
- Layer Violations
-
UI accessing database directly
-
Business logic in controllers
-
Circular module dependencies
- Dependency Tangles
-
Import cycles
-
Bidirectional dependencies
-
God modules everything imports
Prioritization
Focus on hotspots that are:
-
High churn AND high complexity
-
Frequently causing bugs
-
Blocking feature development