build: two-tier checkstyle gate, empty suppressions, fix baseline

Checkstyle is now a ratchet: severity="error" only for rules that are at
zero violations, design-debt rules report as warnings and must be flipped
to error as soon as their backlog hits zero (tracked in TODO.md).

- thresholds tightened: MethodLength 80->40, CyclomaticComplexity 20->15,
  NestedIfDepth 3->2, ParameterNumber 7->5; new rules ReturnCount(5),
  FinalClass, HiddenField, VisibilityModifier; MagicNumber and
  FinalLocalVariable promoted from warning to error (both clean)
- suppressions.xml emptied: 45 legacy entries removed, never add back
- fixed 102 baseline violations (431->329): FinalClass in 37 classes,
  WhitespaceAround in 11 files
- TODO.md: Task 1 done (lolib removed, smoke test passed) and Task 2
  baseline recorded (red report, per-package list, next steps)
This commit is contained in:
loki5512344 2026-10-06 14:17:14 +02:00
parent 4d999c89a8
commit e8b6569ccf
Signed by: boba
GPG key ID: 253067914055423B
46 changed files with 279 additions and 147 deletions

View file

@ -1,88 +1,3 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<!--
Suppressions for legacy files that violate the stricter rules:
- FileLength (200-line limit),
- IllegalCatch (no catch of Exception/Throwable/RuntimeException),
- NPathComplexity (<= 50) and WhitespaceAround.
Legacy files are scheduled for decomposition / cleanup (see docs/ARCHITECTURE.md).
Remove each entry once the file complies on its own.
New files must already comply with ALL rules and must NOT be added here —
EXCEPT two documented defensive boundary catches (see below).
NOTE: the noisy MagicNumber/FinalLocalVariable rules are kept at
severity="warning", so they do not need suppressions.
-->
<suppressions>
<!-- ===== FileLength (200 lines) ===== -->
<!--
===== Intentional defensive boundary catches =====
These are NOT swallowing exceptions:
- LoParkourCommand.onCommand: catches Throwable at the command entry point,
logs the full stack trace and notifies the player (never silent).
- ConfigUpdater: catches Exception to roll back to the backup copy and
rethrows — transactional semantics, the exception is not swallowed.
Do not remove without a review of the intended behavior.
-->
<suppress checks="IllegalCatch" files=".*[\\/]command[\\/]core[\\/]LoParkourCommand\.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]config[\\/]core[\\/]merge[\\/]ConfigUpdater\.java"/>
<!--
SchematicManager: catches RuntimeException so a corrupted/truncated schematic
(WorldEdit/Bukkit throw unchecked exceptions) is skipped instead of breaking
plugin enable. Not swallowing — the failure is logged at SEVERE with the cause.
-->
<suppress checks="IllegalCatch" files=".*[\\/]schematic[\\/]core[\\/]SchematicManager\.java"/>
<!-- ===== IllegalCatch / NPathComplexity / WhitespaceAround (legacy debt) ===== -->
<suppress checks="IllegalCatch" files=".*[\\/]LoParkour.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]adaptive[\\/]bootstrap[\\/]AdaptiveServices.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]bootstrap[\\/]PluginBootstrap.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]command[\\/]player[\\/]PlayerCommandHandler.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]config[\\/]core[\\/]ConfigLoader.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]config[\\/]locale[\\/]LocaleCache.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]config[\\/]locale[\\/]LocaleLoader.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]config[\\/]options[\\/]OptionGeneral.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]generator[\\/]core[\\/]coordinator[\\/]GeneratorProfileManager.java"/>
<suppress checks="WhitespaceAround" files=".*[\\/]generator[\\/]core[\\/]model[\\/]GeneratorState.java"/>
<suppress checks="WhitespaceAround" files=".*[\\/]generator[\\/]effect[\\/]EffectManager.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]generator[\\/]jump[\\/]calculation[\\/]JumpDirector.java"/>
<suppress checks="IllegalCatch|NPathComplexity" files=".*[\\/]generator[\\/]jump[\\/]calculation[\\/]JumpValidator.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]generator[\\/]jump[\\/]placement[\\/]BlockSelector.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]generator[\\/]lifecycle[\\/]loop[\\/]LifecycleEventManager.java"/>
<suppress checks="NPathComplexity|WhitespaceAround" files=".*[\\/]generator[\\/]lifecycle[\\/]player[\\/]GeneratorCleanup.java"/>
<suppress checks="WhitespaceAround" files=".*[\\/]hook[\\/]floodgate[\\/]FloodgateHook.java"/>
<suppress checks="IllegalCatch|NPathComplexity|WhitespaceAround" files=".*[\\/]hook[\\/]holo[\\/]HoloHook.java"/>
<suppress checks="WhitespaceAround" files=".*[\\/]hook[\\/]vault[\\/]VaultHook.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]leaderboard[\\/]core[\\/]LeaderboardSorter.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]listener[\\/]gameplay[\\/]ParkourRestrictionListener.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]listener[\\/]schematic[\\/]SchematicWandListener.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]menu[\\/]community[\\/]LeaderboardsMenu.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]menu[\\/]community[\\/]SingleLeaderboardMenu.java"/>
<suppress checks="WhitespaceAround" files=".*[\\/]menu[\\/]core[\\/]screen[\\/]DynamicMenu\.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]menu[\\/]core[\\/]screen[\\/]MainMenu\.java"/>
<suppress checks="WhitespaceAround" files=".*[\\/]menu[\\/]core[\\/]MenuStub.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]menu[\\/]lobby[\\/]LobbyMenu.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]menu[\\/]lobby[\\/]PlayerManagementMenu.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]menu[\\/]play[\\/]SingleMenu.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]menu[\\/]play[\\/]SpectatorMenu.java"/>
<suppress checks="WhitespaceAround" files=".*[\\/]mode[\\/]impl[\\/]solo[\\/]GravityShiftMode\.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]player[\\/]data[\\/]InventoryData.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]player[\\/]data[\\/]PreviousData.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]player[\\/]service[\\/]ui[\\/]ScoreboardManager\.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]player[\\/]service[\\/]UserRegistry.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]reward[\\/]core[\\/]Reward.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]session[\\/]manager[\\/]SessionStateManager.java"/>
<suppress checks="IllegalCatch" files=".*[\\/]storage[\\/]sql[\\/]SQLConnectionManager.java"/>
<suppress checks="WhitespaceAround" files=".*[\\/]storage[\\/]sql[\\/]SQLDataMapper.java"/>
<suppress checks="NPathComplexity|WhitespaceAround" files=".*[\\/]util[\\/]item[\\/]Materials.java"/>
<suppress checks="NPathComplexity" files=".*[\\/]world[\\/]core[\\/]World.java"/>
</suppressions>
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions/>