Complexity Heatmap
The complexity heatmap visualizes extraction difficulty across modules. Hotter regions indicate higher complexity, more coupling, and greater risk during extraction.
Interactive Visualization
Section titled “Interactive Visualization”What This Shows
Section titled “What This Shows”The heatmap renders data from complexity.json using ERPNext as the reference dataset:
- Color intensity reflects lines of code and cyclomatic complexity
- Cell size corresponds to function count
- Labels show file paths and key metrics
- Tier indicators mark Extract Now (green), Extract With Care (yellow), and Defer (red)
ERPNext Complexity Profile
Section titled “ERPNext Complexity Profile”The top complexity hotspots from the ERPNext reference dataset:
| File | Lines | Functions | Tier |
|---|---|---|---|
controllers/accounts_controller.py | 4,412 | 168 | Defer (decompose first) |
stock/doctype/stock_entry/stock_entry.py | 4,149 | 120 | Defer |
accounts/doctype/payment_entry/payment_entry.py | 3,559 | 95 | Extract With Care |
accounts/doctype/sales_invoice/sales_invoice.py | 3,167 | 85 | Extract With Care |
stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py | 3,285 | 90 | Defer |
Reading the Heatmap
Section titled “Reading the Heatmap”| Color | Tier | Action |
|---|---|---|
| Green | Tier 1: Extract Now | Low complexity, clear boundaries. Extract immediately. |
| Yellow | Tier 2: Extract With Care | Moderate complexity. Needs ACL at boundaries and careful testing. |
| Red | Tier 3: Defer | High complexity. Decompose or defer until dependencies are resolved. |
Using Complexity Data
Section titled “Using Complexity Data”The heatmap answers:
- Where is the risk? — Red zones need senior engineering judgment
- What can we extract today? — Green zones are safe starting points
- What needs decomposition? — God-classes (>2,000 LOC) should be split before extraction
- Where should parity tests focus? — High-complexity files need the most thorough testing
Next Steps
Section titled “Next Steps”- complexity.json Specification — Full field reference
- Progress Dashboard — Track extraction progress