Skip to content

Fix the code smells SonarCloud raised on Boxed II - #146

Merged
tastybento merged 1 commit into
developfrom
fix/sonar-smells
Nov 25, 2026
Merged

tastybento merged 1 commit into
developfrom
fix/sonar-smells

Conversation

@tastybento

Copy link
Copy Markdown
Member

Clears the 18 issues SonarCloud left open on #145. No change in behaviour.

  • Long methods split: the AreaManager constructor, TemplateBuilder.toRawChunk and BoxCleaner.restore.
  • Name clash: the rows field in AreaManager is now areaByRow, so it no longer differs from the ROWS constant only by case.
  • No null arrays: TemplateFile.read returns an empty array for a missing chunk.
  • Deleting a seed world: uses Files.delete, so a file that cannot be deleted is reported. Before, the failure was silent.
  • Small tidy-ups: unnamed catch variables, computeIfAbsent, a record pattern, a constant for a repeated literal, an unused import, a loop that changed its own counter, and two test style points.

Testing

  • 239 unit tests pass.
  • Rebuilt both templates of an area on a Paper 26.3 server with this build; the files come out the same size as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HBXcjZkd22rGNW5ZyL1git

- Split the long methods in AreaManager, TemplateBuilder and BoxCleaner
- Rename the AreaManager field that clashed with a constant
- TemplateFile.read returns an empty array, not null, for a missing chunk
- Delete seed world files with Files.delete so a failure is reported
- Smaller tidy-ups: unnamed catch variables, computeIfAbsent, a record
  pattern, a constant for a repeated literal, an unused import, and a loop
  that changed its own counter

No change in behaviour.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HBXcjZkd22rGNW5ZyL1git
@sonarqubecloud

Copy link
Copy Markdown

@tastybento
tastybento merged commit 1d90889 into develop Nov 25, 2026
3 checks passed
@tastybento
tastybento deleted the fix/sonar-smells branch November 26, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant