Aktualisierung der PMD / Spotbugs Konfiguration.

This commit is contained in:
Konrad Neitzel
2022-08-13 16:56:28 +02:00
parent 675de7d70b
commit ce9e0f96b2
3 changed files with 50 additions and 6 deletions
+25 -3
View File
@@ -14,11 +14,26 @@
<exclude name="SystemPrintln" /> <exclude name="SystemPrintln" />
</rule> </rule>
<rule ref="category/java/codestyle.xml" /> <rule ref="category/java/codestyle.xml">
<!-- That is not my code style! -->
<exclude name="AtLeastOneConstructor" />
<rule ref="category/java/design.xml" /> <!-- long variables are acceptable -->
<exclude name="LongVariable"/>
<rule ref="category/java/documentation.xml" /> <!-- Multiple return statements are ok -->
<exclude name="OnlyOneReturn"/>
</rule>
<rule ref="category/java/design.xml">
<!-- Problems with builder and streams/lambdas -->
<exclude name="LawOfDemeter" />
</rule>
<rule ref="category/java/documentation.xml">
<!-- Long comments are not a problem! -->
<exclude name="CommentSize"/>
</rule>
<rule ref="category/java/errorprone.xml" /> <rule ref="category/java/errorprone.xml" />
@@ -28,4 +43,11 @@
<rule ref="category/java/security.xml" /> <rule ref="category/java/security.xml" />
<rule ref="category/java/design.xml/LoosePackageCoupling">
<properties>
<property name="packages">
<value>de.kneitzel</value>
</property>
</properties>
</rule>
</ruleset> </ruleset>
+14
View File
@@ -74,6 +74,7 @@
<build> <build>
<plugins> <plugins>
<!-- Enforcer to enforce min Maven version -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId> <artifactId>maven-enforcer-plugin</artifactId>
@@ -95,6 +96,7 @@
</executions> </executions>
</plugin> </plugin>
<!-- Compiler including Lobok -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
@@ -111,6 +113,7 @@
</configuration> </configuration>
</plugin> </plugin>
<!-- Test execution -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
@@ -120,6 +123,7 @@
</configuration> </configuration>
</plugin> </plugin>
<!-- Copy dependencies -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
@@ -140,6 +144,8 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- Build image -->
<plugin> <plugin>
<groupId>org.moditect</groupId> <groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId> <artifactId>moditect-maven-plugin</artifactId>
@@ -204,6 +210,8 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- Build JPackage App-Image -->
<plugin> <plugin>
<groupId>com.github.akman</groupId> <groupId>com.github.akman</groupId>
<artifactId>jpackage-maven-plugin</artifactId> <artifactId>jpackage-maven-plugin</artifactId>
@@ -224,6 +232,7 @@
</executions> </executions>
</plugin> </plugin>
<!-- Spotbugs Code Analyzer -->
<plugin> <plugin>
<groupId>com.github.spotbugs</groupId> <groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId> <artifactId>spotbugs-maven-plugin</artifactId>
@@ -248,8 +257,12 @@
</goals> </goals>
</execution> </execution>
</executions> </executions>
<configuration>
<excludeFilterFile>spotbugs-exclude-filter.xml</excludeFilterFile>
</configuration>
</plugin> </plugin>
<!-- PMD static code analysis -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId> <artifactId>maven-pmd-plugin</artifactId>
@@ -298,6 +311,7 @@
</executions> </executions>
</plugin> </plugin>
<!-- Check for new versions in dependencies -->
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId> <artifactId>versions-maven-plugin</artifactId>
+8
View File
@@ -0,0 +1,8 @@
<FindBugsFilter>
<Match>
<!-- We store references we get from outside and we give stored references to the outside -->
<!-- EI: May expose internal representation by returning reference to mutable object -->
<!-- EI2: May expose internal representation by incorporating reference to mutable object -->
<Bug code="EI,EI2"/>
</Match>
</FindBugsFilter>