|
| 1 | +# Tasks: SoftwareCatalog Legacy Quality Cleanup |
| 2 | + |
| 3 | +## Phase 1 — Inventory + planning |
| 4 | + |
| 5 | +- [ ] Run `composer phpcs` and capture current baseline error count |
| 6 | + (target: starting from 4 exclude-patterns in phpcs.xml) |
| 7 | +- [ ] Run `composer phpmd` for the first time as a unified gate |
| 8 | + and capture violation count + categories |
| 9 | +- [ ] Run `composer phpstan` for the first time as a unified gate |
| 10 | + and capture error count + categories |
| 11 | +- [ ] Decide per gate: fix-outright (if <50 violations) or capture |
| 12 | + a fresh baseline (if larger) |
| 13 | +- [ ] Confirm CI runs `composer check:strict` on every PR before |
| 14 | + starting burn-down work |
| 15 | + |
| 16 | +## Phase 2 — PHPCS burn-down (per excluded file) |
| 17 | + |
| 18 | +For each file: fix errors, remove the phpcs.xml `<exclude-pattern>` |
| 19 | +entry, verify gate stays green. |
| 20 | + |
| 21 | +- [ ] Excluded file 1 — fix sniffs + drop exclude |
| 22 | +- [ ] Excluded file 2 — fix sniffs + drop exclude |
| 23 | +- [ ] Excluded file 3 — fix sniffs + drop exclude |
| 24 | +- [ ] Excluded file 4 — fix sniffs + drop exclude |
| 25 | +- [ ] Once all excludes are gone, drop the legacy-debt block from |
| 26 | + phpcs.xml entirely |
| 27 | + |
| 28 | +## Phase 3 — PHPMD burn-down |
| 29 | + |
| 30 | +Contingent on Phase 1's first-run output. If volume is small, this |
| 31 | +phase collapses to a single fix-outright PR. |
| 32 | + |
| 33 | +- [ ] If baseline captured: ElseExpression — re-shape `if/else` to |
| 34 | + early-return |
| 35 | +- [ ] If baseline captured: CyclomaticComplexity / NPathComplexity — |
| 36 | + extract methods |
| 37 | +- [ ] If baseline captured: MissingImport — add `use` statements |
| 38 | +- [ ] If baseline captured: StaticAccess — replace with DI |
| 39 | +- [ ] If baseline captured: variable-naming sniffs (Long/Short/ |
| 40 | + Undefined/UnusedFormalParameter) |
| 41 | +- [ ] Once baseline reaches 0 lines: delete phpmd.baseline.xml and |
| 42 | + drop `--baseline-file` from composer.json's phpmd script |
| 43 | + |
| 44 | +## Phase 4 — PHPStan burn-down |
| 45 | + |
| 46 | +Contingent on Phase 1's first-run output. If volume is small, this |
| 47 | +phase collapses to a single fix-outright PR. |
| 48 | + |
| 49 | +- [ ] Inventory phpstan errors by file/type |
| 50 | +- [ ] Common patterns to fix: |
| 51 | + - [ ] Missing return-type / param-type declarations |
| 52 | + - [ ] Mixed types (specify generic / union) |
| 53 | + - [ ] Possibly-null dereferences |
| 54 | +- [ ] Once baseline reaches 0 lines (or never created): confirm |
| 55 | + gate runs clean against current code |
| 56 | + |
| 57 | +## Phase 5 — CI integration |
| 58 | + |
| 59 | +- [ ] Verify `composer check:strict` runs in CI on every PR |
| 60 | +- [ ] Once all baselines are empty: |
| 61 | + - [ ] Delete `phpmd.baseline.xml` (if it was created) |
| 62 | + - [ ] Delete `phpstan-baseline.neon` (if it was created) |
| 63 | + - [ ] Drop the legacy-debt section from `phpcs.xml` |
| 64 | +- [ ] Add a smoke-test cron that runs `composer check:strict` |
| 65 | + weekly on `development` |
| 66 | + |
| 67 | +## Phase 6 — Documentation |
| 68 | + |
| 69 | +- [ ] Update README quality-gates section |
| 70 | +- [ ] Note in `app-config.json` that legacy quality cleanup is done |
| 71 | +- [ ] Close the burn-down tracking issue once the last baseline |
| 72 | + line is removed |
0 commit comments