Skip to content

Commit

Permalink
TASK-4170 updated pmd-ruleset.xml to PMD 7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf2323 committed May 14, 2024
1 parent a1ef385 commit 5d89928
Showing 1 changed file with 33 additions and 23 deletions.
56 changes: 33 additions & 23 deletions configs/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion"/>
<rule ref="category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault"/>
<rule ref="category/java/bestpractices.xml/SystemPrintln"/>
<rule ref="category/java/bestpractices.xml/UnnecessaryVarargsArrayCreation" />
<rule ref="category/java/bestpractices.xml/UnusedAssignment"/>
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable"/>
Expand All @@ -66,7 +67,7 @@

<rule ref="category/java/codestyle.xml/AtLeastOneConstructor">
<properties>
<property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[matches(@Image, '^.*(IT|Tests|Fixture)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Tests|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/AvoidDollarSigns"/>
Expand All @@ -77,26 +78,27 @@
<rule ref="category/java/codestyle.xml/CallSuperInConstructor"/>
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
<properties>
<property name="violationSuppressXPath" value="//ClassOrInterfaceBodyDeclaration/Annotation/MarkerAnnotation//Name[@Image='Nested']" />
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[pmd-java:hasAnnotation('org.junit.jupiter.api.Nested')]" />
<property name="testClassPattern" value="^[A-Z][a-zA-Z0-9]*(IT|Tests)$"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/CommentDefaultAccessModifier">
<properties>
<property name="ignoredAnnotations" value="com.google.common.annotations.VisibleForTesting
| android.support.annotation.VisibleForTesting
| org.junit.jupiter.api.Test
| org.junit.jupiter.api.ParameterizedTest
| org.junit.jupiter.api.RepeatedTest
| org.junit.jupiter.api.TestFactory
| org.junit.jupiter.api.TestTemplate
| org.junit.jupiter.api.BeforeEach
| org.junit.jupiter.api.BeforeAll
| org.junit.jupiter.api.AfterEach
| org.junit.jupiter.api.AfterAll
| org.junit.jupiter.api.Nested
| org.junit.jupiter.params.ParameterizedTest
| org.jetbrains.annotations.VisibleForTesting
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Tests)$')]"/>
<property name="ignoredAnnotations" value="com.google.common.annotations.VisibleForTesting,
android.support.annotation.VisibleForTesting,
org.junit.jupiter.api.Test,
org.junit.jupiter.api.ParameterizedTest,
org.junit.jupiter.api.RepeatedTest,
org.junit.jupiter.api.TestFactory,
org.junit.jupiter.api.TestTemplate,
org.junit.jupiter.api.BeforeEach,
org.junit.jupiter.api.BeforeAll,
org.junit.jupiter.api.AfterEach,
org.junit.jupiter.api.AfterAll,
org.junit.jupiter.api.Nested,
org.junit.jupiter.params.ParameterizedTest,
org.jetbrains.annotations.VisibleForTesting
"/>
</properties>
</rule>
Expand All @@ -116,9 +118,10 @@
<rule ref="category/java/codestyle.xml/FormalParameterNamingConventions"/>
<rule ref="category/java/codestyle.xml/GenericsNaming"/>
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
<rule ref="category/java/codestyle.xml/LambdaCanBeMethodReference" />
<rule ref="category/java/codestyle.xml/LinguisticNaming">
<properties>
<property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[matches(@Image, '^.*(IT|Tests)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Tests)$')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/LocalHomeNamingConvention"/>
Expand All @@ -141,17 +144,18 @@
<rule ref="category/java/codestyle.xml/RemoteSessionInterfaceNamingConvention"/>
<rule ref="category/java/codestyle.xml/ShortClassName">
<properties>
<property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[matches(@Image, '^.*(IT|Tests)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Tests)$')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/ShortMethodName"/>
<rule ref="category/java/codestyle.xml/ShortVariable"/>
<rule ref="category/java/codestyle.xml/TooManyStaticImports">
<properties>
<property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[matches(@Image, '^.*(IT|Tests|Fixture)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Tests|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/codestyle.xml/UnnecessaryAnnotationValueElement"/>
<rule ref="category/java/codestyle.xml/UnnecessaryBoxing" />
<rule ref="category/java/codestyle.xml/UnnecessaryCast"/>
<!--<rule ref="category/java/codestyle.xml/UnnecessaryConstructor"/>-->
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName"/>
Expand All @@ -161,6 +165,7 @@
<rule ref="category/java/codestyle.xml/UnnecessaryReturn"/>
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon"/>
<rule ref="category/java/codestyle.xml/UseDiamondOperator"/>
<rule ref="category/java/codestyle.xml/UseExplicitTypes" />
<rule ref="category/java/codestyle.xml/UselessParentheses"/>
<rule ref="category/java/codestyle.xml/UselessQualifiedThis"/>
<rule ref="category/java/codestyle.xml/UseShortArrayInitializer"/>
Expand Down Expand Up @@ -189,7 +194,11 @@
<rule ref="category/java/design.xml/GodClass"/>
<rule ref="category/java/design.xml/ImmutableField"/>
<rule ref="category/java/design.xml/InvalidJavaBean"/>
<!--<rule ref="category/java/design.xml/LawOfDemeter"/>-->
<rule ref="category/java/design.xml/LawOfDemeter">
<properties>
<property name="trustRadius" value="3"/>
</properties>
</rule>
<rule ref="category/java/design.xml/LogicInversion"/>
<!--<rule ref="category/java/design.xml/LoosePackageCoupling"/>-->
<rule ref="category/java/design.xml/MutableStaticState"/>
Expand All @@ -205,7 +214,7 @@
<rule ref="category/java/design.xml/TooManyFields"/>
<rule ref="category/java/design.xml/TooManyMethods">
<properties>
<property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[matches(@Image, '^.*(IT|Tests)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Tests)$')]"/>
</properties>
</rule>
<rule ref="category/java/design.xml/UselessOverridingMethod"/>
Expand All @@ -215,7 +224,7 @@
<rule ref="category/java/documentation.xml/CommentContent"/>
<rule ref="category/java/documentation.xml/CommentRequired">
<properties>
<property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[matches(@Image, '^.*(IT|Tests|Fixture)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Tests|Fixture)$')]"/>
</properties>
</rule>
<rule ref="category/java/documentation.xml/CommentSize">
Expand All @@ -239,7 +248,7 @@
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals">
<properties>
<property name="skipAnnotations" value="true" />
<property name="violationSuppressXPath" value="//ClassOrInterfaceDeclaration[matches(@Image, '^.*(IT|Tests)$')]"/>
<property name="violationSuppressXPath" value="//ancestor::ClassDeclaration[matches(@SimpleName, '^.*(IT|Tests)$')]"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/AvoidEnumAsIdentifier"/>
Expand All @@ -261,6 +270,7 @@
<rule ref="category/java/errorprone.xml/CloneMethodReturnTypeMustMatchClassName"/>
<rule ref="category/java/errorprone.xml/CloseResource"/>
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals"/>
<rule ref="category/java/errorprone.xml/ConfusingArgumentToVarargsMethod" />
<rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod"/>
<rule ref="category/java/errorprone.xml/DetachedTestCase"/>
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
Expand Down

0 comments on commit 5d89928

Please sign in to comment.