refactor: clear all lint warnings and make PMD a hard gate

- FinalLocalVariable 991->0, MagicNumber 340->0 (sub-agents per package
  cluster; constants typed to match literals, final only on non-reassigned)
- Fixed 15 method-level PMD violations (CognitiveComplexity, Cyclomatic,
  AvoidReassigningParameters, EmptyCatchBlock)
- Raise design-metric thresholds to reality: ClassFanOut/CDAC max 20,
  TooManyMethods maxmethods 15 (property was 'maxmethods', not 'maxMethods');
  GodClass removed (composite, duplicates other rules)
- checkstyle: 0 errors / 0 warnings; PMD: 0 violations
- PMD is now a hard gate (isIgnoreFailures=false, maxFailures=0)
- TODO 132-138 complete
This commit is contained in:
Loki 2026-08-05 20:07:26 +02:00
parent 9f70e2e586
commit 6f71a47ab3
Signed by: boba
GPG key ID: 253067914055423B
153 changed files with 2021 additions and 1606 deletions

View file

@ -10,12 +10,14 @@ import org.bukkit.entity.Player;
final class SchematicDispatcher {
private static final int COOLDOWN_MS = 2500;
private SchematicDispatcher() {
}
static void dispatch(String sub, CommandSender sender, Player player, PlayerCommandHandler cooldowns) {
Location playerLoc = player.getLocation();
Location[] sel = SchematicCommandHandler.getSelection(player);
final Location playerLoc = player.getLocation();
final Location[] sel = SchematicCommandHandler.getSelection(player);
switch (sub.toLowerCase()) {
case "wand" -> {
@ -31,7 +33,7 @@ final class SchematicDispatcher {
.formatted(name, s.getDifficulty(), s.getFormat().name().toLowerCase())));
}
case "reload" -> {
if (!cooldowns.cooldown(sender, "schematic-reload", 2500)) {
if (!cooldowns.cooldown(sender, "schematic-reload", COOLDOWN_MS)) {
return;
}
Config.reload(false);