| name | refactor-impact |
| description | Measure the impact of refactoring using statico before/after analysis. Snapshots code health before changes and compares after. Use when planning or completing a refactoring, measuring code quality improvements, or verifying cleanup effectiveness. |
/refactor-impact โ Refactoring Impact Analysis
Setup
Build statico if not already built:
cd /Users/dom/programming/statico && cargo build --release --features deep-resolution
Workflow
Before refactoring
/Users/dom/programming/statico/target/release/statico analyze . --format json --quiet > .statico/before.json
Parse the JSON and note:
- Health score
- Dead code count
- Unused exports count
- Circular deps count
- Duplication %
After refactoring
/Users/dom/programming/statico/target/release/statico analyze . --format json --quiet > .statico/after.json
Compare
/Users/dom/programming/statico/target/release/statico diff .statico/before.json .statico/after.json
Present the diff results:
- Health score change (+/-)
- Issues fixed / issues introduced
- LOC removed / added
- Duplication change
- Summary: "Refactoring improved health by {N} points, removed {M} dead files"
Example Output
๐ Refactoring Impact Report
Health: 53.9 โ 68.2 (+14.3)
Dead code: 12 โ 3 (-9 files)
Unused exports: 847 โ 612 (-235)
Duplication: 18.2% โ 14.1% (-4.1%)
One-liner for quick check
/Users/dom/programming/statico/target/release/statico analyze . --format context --quiet