- LavalinkManager: httpTimeout back to 30s (stagger delays are the real fix) - checkstyle: comprehensive ruleset from LoParkour (200-line files, complexity, naming) - PMD: ruleset with CognitiveComplexity, CloseResource, TooManyMethods etc - Both tools run with ignoreFailures=true (warnings only, don't block build)
45 lines
1.7 KiB
XML
45 lines
1.7 KiB
XML
<?xml version="1.0"?>
|
|
|
|
<ruleset name="Loki Bot 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.
|
|
UnusedImports is excluded (handled by checkstyle).
|
|
</description>
|
|
|
|
<!-- ===== bugs / error-prone ===== -->
|
|
<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 ===== -->
|
|
<rule ref="category/java/design.xml/TooManyFields"/>
|
|
<rule ref="category/java/design.xml/TooManyMethods">
|
|
<properties>
|
|
<property name="maxmethods" value="15"/>
|
|
</properties>
|
|
</rule>
|
|
</ruleset>
|