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:
parent
9f70e2e586
commit
6f71a47ab3
153 changed files with 2021 additions and 1606 deletions
|
|
@ -1,4 +1,5 @@
|
|||
package dev.loki.loparkour.player.service;
|
||||
|
||||
import dev.loki.loparkour.player.core.ParkourUser;
|
||||
import dev.loki.loparkour.player.core.ParkourPlayer;
|
||||
|
||||
|
|
@ -33,14 +34,14 @@ public final class UserRegistry {
|
|||
|
||||
public static @NotNull ParkourPlayer register(@NotNull Player player, @NotNull Session session) {
|
||||
PreviousData data = null;
|
||||
ParkourUser existing = getUser(player);
|
||||
final ParkourUser existing = getUser(player);
|
||||
|
||||
if (existing != null) {
|
||||
data = existing.previousData;
|
||||
unregister(existing, false, false, false);
|
||||
}
|
||||
|
||||
ParkourPlayer pp = new ParkourPlayer(player, session, data);
|
||||
final ParkourPlayer pp = new ParkourPlayer(player, session, data);
|
||||
joinCount++;
|
||||
new ParkourJoinEvent(pp).call();
|
||||
Storage.readPlayer(pp);
|
||||
|
|
@ -49,7 +50,7 @@ public final class UserRegistry {
|
|||
}
|
||||
|
||||
public static void leave(@NotNull Player player) {
|
||||
ParkourUser user = getUser(player);
|
||||
final ParkourUser user = getUser(player);
|
||||
if (user != null) {
|
||||
leave(user);
|
||||
}
|
||||
|
|
@ -98,7 +99,7 @@ public final class UserRegistry {
|
|||
}
|
||||
|
||||
public static int getJoinCount() {
|
||||
int count = joinCount;
|
||||
final int count = joinCount;
|
||||
joinCount = 0;
|
||||
return count;
|
||||
}
|
||||
|
|
@ -129,7 +130,7 @@ public final class UserRegistry {
|
|||
}
|
||||
|
||||
if (user instanceof ParkourPlayer player) {
|
||||
Mode finalMode = mode;
|
||||
final Mode finalMode = mode;
|
||||
user.previousData.onLeave.forEach(r -> r.execute(player, finalMode));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue