werkcrappit's complex methods split, the ratchet at 11 (0.16.3) #32

Merged
mi merged 1 commits from mihoe/split-complex-methods into main 2026-10-03 18:21:02 +02:00
Owner

Related Links

  • PR#31, which left these four methods as a follow-up

The Problem

Four methods of werkcrappit were red in its own city although their tests killed most mutants: Mutation-CRAP is never below the complexity, and theirs was 12 to 19.

Non-Goals

  • New behaviour or new tests: the existing tests carry the refactoring.

The Solution

  • RealLines.count (complexity 19) is a small scanner with one method per state: code, block comment, text block.
  • Gate.judge (15) checks the report header in judgeable, judges each method in its own judge, and only sums up itself.
  • JsonReader.string (13) leaves escapes to escaped and \u escapes to unicode.
  • CodeChartaExport.export (12) leaves the warnings about buildings to warnAbout and the source links to links.
  • The ratchet goes down: maxMutationCrap = 11, the highest value after the split, Json.write at 11.0; colorRedFrom = 9 stays.
  • Version 0.16.3.

Attachments

Local PIT runs of werkcrappit-pit

PR#31 This PR
Highest Mutation-CRAP 19.6 11.0
Methods at 9 or more 10 8
Red classes (from 9) 8 of 45 6 of 45
Mutants killed 88 % 88 %

🤖 Generated with Claude Code

## Related Links - [PR#31](2026-10-03-PR%2331-own-hotspots.md), which left these four methods as a follow-up ## The Problem Four methods of werkcrappit were red in its own city although their tests killed most mutants: Mutation-CRAP is never below the complexity, and theirs was 12 to 19. ## Non-Goals - New behaviour or new tests: the existing tests carry the refactoring. ## The Solution - `RealLines.count` (complexity 19) is a small scanner with one method per state: code, block comment, text block. - `Gate.judge` (15) checks the report header in `judgeable`, judges each method in its own `judge`, and only sums up itself. - `JsonReader.string` (13) leaves escapes to `escaped` and `\u` escapes to `unicode`. - `CodeChartaExport.export` (12) leaves the warnings about buildings to `warnAbout` and the source links to `links`. - The ratchet goes down: `maxMutationCrap = 11`, the highest value after the split, `Json.write` at 11.0; `colorRedFrom = 9` stays. - Version 0.16.3. ## Attachments ### Local PIT runs of werkcrappit-pit | | PR#31 | This PR | |---|---|---| | Highest Mutation-CRAP | 19.6 | 11.0 | | Methods at 9 or more | 10 | 8 | | Red classes (from 9) | 8 of 45 | 6 of 45 | | Mutants killed | 88 % | 88 % | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mi added 1 commit 2026-10-03 17:50:15 +02:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mi merged commit 919d31ce9d into main 2026-10-03 18:21:02 +02:00
mi deleted branch mihoe/split-complex-methods 2026-10-03 18:21:02 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkcrappit#32