Fix open SonarCloud issues (blockers through info) - #133
Merged
Conversation
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Addresses all 107 open issues on SonarCloud for this project, worked in severity order (Blocker → High → Medium → Low → Info).
AdvancementListenerTestonPortal tests now contain assertions.AbstractSeedBiomeProviderenum constants renamed, 15 cognitive-complexity methods rewritten asswitchexpressions over shared helpers, 3 duplicate methods removed; complexity splits inNewAreaListener,EnderPearlListener,AdminPlaceStructureCommand,BoxedBlockPopulator,BoxedChunkGenerator;repeatCalcis now an instance method (plus a pure staticrepeatCalc(int,int)) instead of relying on a staticsizeassigned in the constructor.Registry.BIOME,Biome.CUSTOM,Biome.valueOf,TeleportCause.CHORUS_FRUIT,isUsesNewChunkGenerationoverride), unused fields/params/imports, always-true null checks, missing@Overrides, null → empty-list returns, commented-out code, TODOs, redundant test visibility, superfluousthrows Exception.Behaviour notes
weirdness < 0 && (t == 0 || t == 1) || humidity == 4(missing parentheses); unified on the parenthesised form used everywhere else.biomes.ymlCUSTOM/ unknown biome names now map tonull(use vanilla) via the registry lookup — same downstream behaviour as the oldBiome.CUSTOMsentinel.Test plan
mvn test— 167 tests, 0 failures🤖 Generated with Claude Code
https://claude.ai/code/session_01RgbmBTXKJzbhGKMuGKfaBm