diff --git a/build.gradle b/build.gradle index c262402..05f9dd7 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'application' id 'checkstyle' + id 'pmd' alias(libs.plugins.spotbugs) id 'com.diffplug.spotless' version '6.25.0' } @@ -78,6 +79,12 @@ checkstyle { ignoreFailures = true } +pmd { + ruleSets = [] + ruleSetFiles = files("${rootDir}/config/pmd/ruleset.xml") + ignoreFailures = true +} + spotbugs { excludeFilter = file("${rootDir}/config/spotbugs/exclude.xml") ignoreFailures = false diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 5b25313..e283fdb 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -1,103 +1,150 @@ - - + + + - + - - + + + + + + + + - - - - - - + - - - - + + + + + - - - + + + - - - + + + - - + + + + + + + - - + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -106,25 +153,5 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml new file mode 100644 index 0000000..7295c20 --- /dev/null +++ b/config/checkstyle/suppressions.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/pmd/ruleset.xml b/config/pmd/ruleset.xml index 5eaeaba..c64ce13 100644 --- a/config/pmd/ruleset.xml +++ b/config/pmd/ruleset.xml @@ -1,95 +1,45 @@ - - + + + xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.io/ruleset_2_0_0.xsd"> - PMD rules for Loki Discord Bot + + 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). + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/src/main/java/creator/loki/feature/music/core/LavalinkManager.java b/src/main/java/creator/loki/feature/music/core/LavalinkManager.java index 5e8b355..2438650 100644 --- a/src/main/java/creator/loki/feature/music/core/LavalinkManager.java +++ b/src/main/java/creator/loki/feature/music/core/LavalinkManager.java @@ -55,7 +55,7 @@ public class LavalinkManager { .setName("main") .setServerUri(lavalinkConfig.getWsUri()) .setPassword(lavalinkConfig.getPassword()) - .setHttpTimeout(60000L) + .setHttpTimeout(30000L) .build()); registerListeners();