-
Notifications
You must be signed in to change notification settings - Fork 16
Case Study Border Cleanup
rtd edited this page Jan 13, 2026
·
1 revision
Type: REFACTOR Skills: cc-refactoring-guidance → cc-control-flow-quality (CHECKER) → cc-routine-and-class-design (CHECKER) Focus: Post-refactoring quality gates
This example shows the CHECKER gates that run after refactoring to verify code quality wasn't degraded:
- Two skills as quality gates - Control flow + routine design checks
- McCabe complexity analysis - Quantified complexity with thresholds
- Pre-existing vs new issues - Checkers distinguish what you changed from what was already there
- Cohesion classification - Functional vs Temporal cohesion types
[After refactoring work complete]
→ cc-control-flow-quality (CHECKER mode)
→ Analyzes nesting depth and McCabe complexity
→ Flags pre-existing issues separately from new code
→ cc-routine-and-class-design (CHECKER mode)
→ LSP test, parameter counts, naming, cohesion
→ Minimum viable compliance check
| File | Function | Max Nesting | McCabe | Status |
|---|---|---|---|---|
| BorderWindow.swift | updateStyle | 1 (guard clauses) | 6 | ✓ Clean |
| SimpleBorderManager.swift | debugBordersImpl | 2 | 4 | ✓ Clean |
| SimpleBorderManager.swift | setCellAssignmentsImpl | 3 | ~14 |
Key insight: The checker notes setCellAssignmentsImpl complexity is pre-existing - the refactoring only added a dictionary lookup without adding control flow.
| # | Check | Result | Evidence |
|---|---|---|---|
| 1 | LSP test for inheritance | ✓ PASS | No new inheritance introduced |
| 2 | Inheritance depth < 3 | ✓ PASS | No inheritance changes |
| 3 | No empty overrides | ✓ PASS | No overrides in changes |
| 4 | Parameter count ≤ 7 | ✓ PASS | Max 4 params |
| 5 | Routine names describe function | ✓ PASS | debugBorders, updateStyle |
| 6 | Consistent abstraction | ✓ PASS | Single level |
| 7 | Implementation hidden | ✓ PASS | SkyLight details encapsulated |
| Routine | Type | Status |
|---|---|---|
| updateStyle | Functional | ✓ ACCEPT - single operation |
| debugBorders | Functional | ✓ ACCEPT - single operation |
| debugBordersImpl | Temporal | ✓ ACCEPT - orchestration |
| Gate | Result |
|---|---|
| cc-control-flow-quality | PASS (max nesting 2, McCabe < 10 for new code) |
| cc-routine-and-class-design | PASS (functional cohesion, ≤7 params, good naming) |
- CHECKER gates after refactoring - Verify you didn't degrade quality
- McCabe complexity - Quantified threshold (< 10 for new code)
- Pre-existing vs new - Checkers don't blame you for existing issues
- Cohesion types - Functional (ideal) vs Temporal (acceptable for orchestration)
- 7-point compliance check - Systematic coverage of design principles
Task Guides
Case Studies
- Picker History Review ⭐
- Comment Renumbering
- Critical Path Review
- Border Cleanup
- Picker Text Overflow
- Tab Indicator Removal
- Picker Focus Bug
- Window Picker Plan
Reference