Skip to content

Fix open SonarCloud issues (blockers through info) - #133

Merged
tastybento merged 2 commits into
developfrom
sonar/fix-open-issues
Aug 15, 2026
Merged

Fix open SonarCloud issues (blockers through info)#133
tastybento merged 2 commits into
developfrom
sonar/fix-open-issues

Conversation

@tastybento

Copy link
Copy Markdown
Member

Summary

Addresses all 107 open issues on SonarCloud for this project, worked in severity order (Blocker → High → Medium → Low → Info).

  • Blockers: AdvancementListenerTest onPortal tests now contain assertions.
  • Critical: AbstractSeedBiomeProvider enum constants renamed, 15 cognitive-complexity methods rewritten as switch expressions over shared helpers, 3 duplicate methods removed; complexity splits in NewAreaListener, EnderPearlListener, AdminPlaceStructureCommand, BoxedBlockPopulator, BoxedChunkGenerator; repeatCalc is now an instance method (plus a pure static repeatCalc(int,int)) instead of relying on a static size assigned in the constructor.
  • Major/Minor/Info: deprecated API removed (Registry.BIOME, Biome.CUSTOM, Biome.valueOf, TeleportCause.CHORUS_FRUIT, isUsesNewChunkGeneration override), unused fields/params/imports, always-true null checks, missing @Overrides, null → empty-list returns, commented-out code, TODOs, redundant test visibility, superfluous throws Exception.

Behaviour notes

  • One deliberate fix: three erosion-5 branches in the seed biome provider had weirdness < 0 && (t == 0 || t == 1) || humidity == 4 (missing parentheses); unified on the parenthesised form used everywhere else.
  • biomes.yml CUSTOM / unknown biome names now map to null (use vanilla) via the registry lookup — same downstream behaviour as the old Biome.CUSTOM sentinel.

Test plan

  • mvn test — 167 tests, 0 failures
  • SonarCloud analysis on this PR shows the issues resolved

🤖 Generated with Claude Code

https://claude.ai/code/session_01RgbmBTXKJzbhGKMuGKfaBm

tastybento and others added 2 commits August 14, 2026 21:17
Blockers
- AdvancementListenerTest: add assertions to the four onPortal tests.

Critical
- AbstractSeedBiomeProvider: rename enum constants to UPPER_CASE, replace
  the deeply nested erosion/ridge if-chains with switch expressions over
  shared helpers (peaks, slopes/grove, plateau, swamp, erosion-5 cases),
  and drop the three duplicate near-inland/coast methods. Also fixes a
  missing-parentheses precedence bug in the erosion-5 humidity check.
- NewAreaListener: MINECRAFT constant, split onPlayerMove/removeJigsaw,
  remove unused static fields, rename `record` lambda vars, drop dead
  null check and commented code, merge nested if.
- EnderPearlListener: NO_TELEPORT_OUTSIDE constant, extract pearl landing
  handling, remove always-true getTo() null checks.
- AdminPlaceStructureCommand: split canExecute into parse helpers, drop
  unused params/import, log instead of printStackTrace.
- BoxedBlockPopulator / BoxedChunkGenerator: extract helpers.
- AbstractBoxedChunkGenerator: `size` is now an instance field with an
  instance repeatCalc(int) plus a pure static repeatCalc(int, int);
  callers use the generator instance. Constructor is protected.

Major / minor / info
- Replace deprecated Registry.BIOME / Biome.CUSTOM / Biome.valueOf with
  RegistryAccess + NamespacedKey lookups; unknown/CUSTOM biomes map to
  null ("use vanilla") as before.
- Remove deprecated isUsesNewChunkGeneration override (no consumer left
  in BentoBox 3.16.1+); update CLAUDE.md.
- Settings: add missing @OverRide annotations.
- BoxedSeedChunkGenerator: return empty lists instead of null.
- Remove commented-out code and TODO comments across the codebase.
- Tests: drop redundant public modifiers, useless eq(), unused helper
  methods, deprecated CHORUS_FRUIT/PlayerDeathEvent usages, and the
  superfluous throws clause on CommonTestSetup.setUp().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RgbmBTXKJzbhGKMuGKfaBm
- Extract inline mock creations to local variables (S9016).
- Guard OfflinePlayer#getLocation() nullability before getIslandAt (S2637).
- Remove unused java.util.Map import in BoxedBlockPopulator (S1128).

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

Copy link
Copy Markdown

@tastybento
tastybento merged commit fe2bafa into develop Aug 15, 2026
3 checks passed
@tastybento
tastybento deleted the sonar/fix-open-issues branch August 15, 2026 16:09
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