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

@ -41,7 +41,7 @@ public final class AdaptiveServices {
return;
}
Runnable setup = () -> startCollector(createRepository());
final Runnable setup = () -> startCollector(createRepository());
if (Option.SQL) {
Storage.runWhenReady(setup);
} else {
@ -53,7 +53,7 @@ public final class AdaptiveServices {
shutdownCollector();
AdaptiveConfig.reload();
if (plugin != null && AdaptiveConfig.isEnabled()) {
Runnable setup = () -> startCollector(createRepository());
final Runnable setup = () -> startCollector(createRepository());
if (Option.SQL) {
Storage.runWhenReady(setup);
} else {
@ -76,7 +76,7 @@ public final class AdaptiveServices {
return;
}
double target = AdaptiveDifficulty.resolveTargetDifficulty(generator, AdaptiveServices::resolveSkillRating);
final double target = AdaptiveDifficulty.resolveTargetDifficulty(generator, AdaptiveServices::resolveSkillRating);
AdaptiveDifficulty.applyToProfile(profile, target);
}
@ -88,9 +88,9 @@ public final class AdaptiveServices {
return;
}
UUID uuid = player.getUUID();
SkillRating session = AdaptiveDifficulty.analyzeSession(player, metricsCollector);
SkillRating stored = repository.loadSkillRating(uuid);
final UUID uuid = player.getUUID();
final SkillRating session = AdaptiveDifficulty.analyzeSession(player, metricsCollector);
final SkillRating stored = repository.loadSkillRating(uuid);
if (stored != null) {
stored.updateRating(session.getRating(), AdaptiveConfig.getRatingWeight());
@ -123,14 +123,14 @@ public final class AdaptiveServices {
@NotNull
private static SkillRating resolveSkillRating(@NotNull ParkourPlayer player) {
UUID uuid = player.getUUID();
SkillRating stored = repository != null ? repository.loadSkillRating(uuid) : null;
final UUID uuid = player.getUUID();
final SkillRating stored = repository != null ? repository.loadSkillRating(uuid) : null;
if (metricsCollector == null) {
return stored != null ? stored : new SkillRating(uuid);
}
var metrics = metricsCollector.getMetrics(uuid);
final var metrics = metricsCollector.getMetrics(uuid);
if (metrics.getTotalJumps() < AdaptiveConfig.getMinSessions()) {
if (stored != null && stored.isReliable()) {
return stored;
@ -138,7 +138,7 @@ public final class AdaptiveServices {
return stored != null ? stored : new SkillRating(uuid);
}
SkillRating session = AdaptiveDifficulty.analyzeSession(player, metricsCollector);
final SkillRating session = AdaptiveDifficulty.analyzeSession(player, metricsCollector);
if (stored == null) {
return session;
}