refactor: decompose god-classes, add lint gates, restructure packages
- Decompose all 11 god-classes (>200 lines) into facade + collaborators (command/, schematic/, config/, generator/, mode/, papi/, adaptive/, storage/, player/, leaderboard/) — every file is now <=200 lines - Add PMD 7 (report-only) + stricter checkstyle rules (NPath, IllegalCatch, NestedDepth, Whitespace, MissingOverride); fix real bugs found (printStackTrace, resource leaks in ConfigLoader/SQLStatsStorage) - docs/ARCHITECTURE.md: target structure + 'one folder = one purpose' rule - Pilot restructure: command/core|util/, mode/impl/solo|multi|barrier/, hook/papi/resolver/; cross-package classes made public - TODO.md: track warning cleanup (132-138) + restructure progress
This commit is contained in:
parent
1d57972038
commit
81788e71ed
70 changed files with 3428 additions and 1701 deletions
46
config/pmd/ruleset.xml
Normal file
46
config/pmd/ruleset.xml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<ruleset name="LoParkour PMD rules"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.io/ruleset_2_0_0.xsd">
|
||||
|
||||
<description>
|
||||
PMD rules complementing checkstyle. Adds checks checkstyle does not
|
||||
cover: resource leaks, string ==, empty control flow, god-class/size
|
||||
hints and complexity.
|
||||
Currently report-only; becomes a hard gate after the SRP refactor.
|
||||
UnusedImports is excluded (handled by checkstyle).
|
||||
</description>
|
||||
|
||||
<!-- ===== bugs / error-prone ===== -->
|
||||
<!-- Empty if/while/finally blocks are covered by checkstyle (EmptyBlock,
|
||||
EmptyStatement, EmptyCatchBlock); PMD 7 has no generic replacement. -->
|
||||
<rule ref="category/java/errorprone.xml/EmptyCatchBlock"/>
|
||||
<rule ref="category/java/errorprone.xml/UseEqualsToCompareStrings"/>
|
||||
<rule ref="category/java/errorprone.xml/CloseResource"/>
|
||||
<rule ref="category/java/errorprone.xml/UnusedNullCheckInEquals"/>
|
||||
|
||||
<!-- ===== dead code ===== -->
|
||||
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryImport"/>
|
||||
<rule ref="category/java/bestpractices.xml/AvoidReassigningParameters"/>
|
||||
|
||||
<!-- ===== complexity ===== -->
|
||||
<rule ref="category/java/design.xml/CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="methodReportLevel" value="15"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="category/java/design.xml/CognitiveComplexity">
|
||||
<properties>
|
||||
<property name="reportLevel" value="15"/>
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<!-- ===== god-object / size hints (mirrors the 200-line file rule;
|
||||
line count itself is hard-gated by checkstyle FileLength) ===== -->
|
||||
<rule ref="category/java/design.xml/GodClass"/>
|
||||
<rule ref="category/java/design.xml/TooManyFields"/>
|
||||
<rule ref="category/java/design.xml/TooManyMethods"/>
|
||||
</ruleset>
|
||||
Loading…
Add table
Add a link
Reference in a new issue