feat: v8.1 refactoring tools improvements#127
Conversation
🟡 Change Impact Analysis
Blast Radius: 0 modules, 1 files, 147 unique callers 📝 Changed Symbols (409)
🎯 Affected Downstream (20)
Recommendations
Generated by CKB |
🔐 Security Audit Results
📦 Dependency VulnerabilitiesFound 7 vulnerability(ies) across 2 scanner(s) DetailsTrivy (4 findings)
OSV-Scanner (3 findings)
📜 License IssuesFound 144 non-permissive license(s) Details
Generated by CKB Security Audit | View Details | Security Tab |
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (11.7%) is below the target coverage (30.0%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #127 +/- ##
=========================================
- Coverage 44.9% 44.6% -0.4%
=========================================
Files 350 357 +7
Lines 60028 60687 +659
=========================================
+ Hits 27004 27077 +73
- Misses 31188 31769 +581
- Partials 1836 1841 +5
Flags with carried forward coverage won't be shown. Click here to find out more. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
CKB Analysis
Risk factors: Medium-sized PR with 17 files • High churn: 1396 lines changed • Touches 5 hotspot(s)
🎯 Change Impact Analysis · 🟡 MEDIUM · 409 changed → 20 affected
Symbols changed in this PR:
Downstream symbols affected:
Recommendations:
💣 Blast radius · 0 symbols · 2 tests · 0 consumersTests that may break:
🔥 Hotspots · 5 volatile files
📦 Modules · 2 at risk
📊 Complexity · 7 violations
💡 Quick wins · 10 suggestions
📚 Stale docs · 143 broken references
Generated by CKB · Run details |
Five features based on Cursor agent feedback from live refactoring trial: 1. Function-level complexity in auditRisk — wire tree-sitter complexity analyzer into audit, returning per-function cyclomatic+cognitive scores sorted by complexity (top 10 per file). Falls back to heuristic. 2. Graceful degradation messaging — new DegradationWarning type with capability percentages and fix commands. Wired into explore, understand, prepareChange, auditRisk, and findDeadCode MCP handlers. 3. Test gap analysis — new testgap package + analyzeTestGaps MCP tool. Cross-references complexity analysis with SCIP references or heuristic name matching to identify untested functions, sorted by risk. 4. Richer prepareChange for rename/extract — RenameDetail (call sites, type refs, imports with context snippets) and ExtractDetail (boundary analysis) added as parallel goroutines in PrepareChange. 5. Unified planRefactor compound tool — aggregates prepareChange + auditRisk + analyzeTestGaps in parallel, generates ordered refactoring steps by change type (rename/extract/delete/modify). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
056ed94 to
695bd01
Compare
|
Superseded by #128 which includes both batch 1 and batch 2 of the v8.1 refactoring tools. |
Summary
analyzeTestGapstool identifies untested functions using SCIP references or heuristic name matching, sorted by complexityTest plan
go build ./cmd/ckbcompilesgo test ./internal/...— all 52 packages passgo install ./cmd/ckb— binary installsauditRiskresponse includesfunctionComplexity[]explorewith stale index returns degradation warningsanalyzeTestGapsreturns untested functionsprepareChangewithchangeType: "rename"includesrenameDetailplanRefactorreturns combined risk + impact + tests + steps🤖 Generated with Claude Code