.codingstyle.4.10.0.source-code.pmd-tests-configuration.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <!-- ${project.groupId}:${project.artifactId}:${project.version} --> <ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="pmd-eclipse" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd"> <description>Ullrich Hafner's PMD rules</description> <rule ref="category/java/bestpractices.xml"> <exclude name="AccessorMethodGeneration"/> <exclude name="GuardLogStatement"/> <exclude name="JUnit4TestShouldUseTestAnnotation"/> <exclude name="JUnit5TestShouldBePackagePrivate"/> <exclude name="JUnitAssertionsShouldIncludeMessage"/> <exclude name="JUnitTestContainsTooManyAsserts"/> <exclude name="JUnitTestsShouldIncludeAssert"/> <exclude name="LiteralsFirstInComparisons"/> <exclude name="LooseCoupling"/> <exclude name="UnusedPrivateMethod"/> </rule> <rule ref="category/java/codestyle.xml"> <exclude name="AtLeastOneConstructor"/> <exclude name="ClassNamingConventions"/> <exclude name="CommentDefaultAccessModifier"/> <exclude name="ConfusingTernary"/> <exclude name="EmptyControlStatement"/> <exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/> <exclude name="FieldDeclarationsShouldBeAtStartOfClass"/> <exclude name="LocalVariableCouldBeFinal"/> <exclude name="LocalVariableNamingConventions"/> <exclude name="LongVariable"/> <exclude name="OnlyOneReturn"/> <exclude name="ShortClassName"/> <exclude name="ShortVariable"/> <exclude name="UnnecessaryConstructor"/> <exclude name="UseExplicitTypes"/> </rule> <rule ref="category/java/codestyle.xml/ClassNamingConventions"> <properties> <property name="utilityClassPattern" value="[A-Z][a-zA-Z0-9]+"/> <property name="testClassPattern" value="^[A-Z][a-zA-Z0-9]+Test.*$|^[A-Z][a-zA-Z0-9]+Benchmark.*$|"/> </properties> </rule> <rule ref="category/java/codestyle.xml/ConfusingTernary"> <properties> <property name="ignoreElseIf" value="true"/> </properties> </rule> <rule ref="category/java/codestyle.xml/LinguisticNaming"> <properties> <property name="checkSetters" value="false"/> <property name="booleanMethodPrefixes" value="is|has|can|have|will" /> </properties> </rule> <rule ref="category/java/codestyle.xml/UnnecessaryConstructor"> <properties> <property name="ignoredAnnotations" value="org.kohsuke.stapler.DataBoundConstructor"/> </properties> </rule> <rule ref="category/java/design.xml"> <exclude name="AvoidCatchingGenericException"/> <exclude name="AvoidUncheckedExceptionsInSignatures"/> <exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal"/> <exclude name="DataClass"/> <exclude name="ExcessiveImports"/> <exclude name="ExcessiveParameterList"/> <exclude name="FinalFieldCouldBeStatic"/> <exclude name="LawOfDemeter"/> <exclude name="LoosePackageCoupling"/> <exclude name="GodClass"/> <exclude name="SignatureDeclareThrowsException"/> <exclude name="SimplifyBooleanReturns"/> <exclude name="TooManyMethods"/> <exclude name="UseObjectForClearerAPI"/> </rule> <rule ref="category/java/design.xml/SimplifyBooleanReturns"> <properties> <property name="violationSuppressXPath" value="./MethodDeclaration[@Image='equals']"/> </properties> </rule> <rule ref="category/java/errorprone.xml"> <exclude name="AvoidDuplicateLiterals"/> <exclude name="AvoidLiteralsInIfCondition"/> <exclude name="EmptyCatchBlock"/> <exclude name="TestClassWithoutTestCases"/> <exclude name="UseProperClassLoader"/> </rule> <rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition"> <properties> <property name="ignoreMagicNumbers" value="-1,0,1"/> </properties> </rule> <rule ref="category/java/errorprone.xml/EmptyCatchBlock"> <properties> <property name="allowCommentedBlocks" value="true"/> </properties> </rule> <rule ref="category/java/multithreading.xml"> <exclude name="UseConcurrentHashMap"/> </rule> <rule ref="category/java/performance.xml"> <exclude name="AppendCharacterWithChar"/> <exclude name="AvoidInstantiatingObjectsInLoops"/> <exclude name="ConsecutiveAppendsShouldReuse"/> <exclude name="RedundantFieldInitializer"/> <exclude name="UseStringBufferForStringAppends"/> </rule> <rule ref="category/java/security.xml"> </rule> </ruleset>