global-build-tools.pmd-ruleset.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of io.wcm.maven.global-build-tools
Show all versions of io.wcm.maven.global-build-tools
Definition of rules for static code analysis tools and IDEs.
<?xml version="1.0" encoding="UTF-8"?> <!-- #%L wcm.io %% Copyright (C) 2014 wcm.io %% Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. #L% --> <!-- Note: The basic setup of this PMD rulset is borrowed from the ExcepGen project http://excepgen.googlecode.com/svn-history/r13/trunk/scm/pmd-ruleset.xml --> <ruleset name="wcm.io" 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.net/ruleset_2_0_0.xsd"> <description>PMD static code analysis rule set</description> <!-- Exclude test classes --> <exclude-pattern>.*/src/test/.*</exclude-pattern> <!-- Exclude target folder that may contain generated sources --> <exclude-pattern>.*/target/.*</exclude-pattern> <!-- rules previously in rulesets/java/empty.xml --> <rule ref="category/java/errorprone.xml/EmptyFinallyBlock" /> <rule ref="category/java/errorprone.xml/EmptyInitializer" /> <rule ref="category/java/errorprone.xml/EmptyStatementBlock" /> <rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" /> <rule ref="category/java/errorprone.xml/EmptyInitializer" name="EmptyStaticInitializer" /> <rule ref="category/java/errorprone.xml/EmptySwitchStatements" /> <rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" /> <rule ref="category/java/errorprone.xml/EmptyTryBlock" /> <rule ref="category/java/errorprone.xml/EmptyWhileStmt" /> <!-- rules previously in rulesets/java/braces.xml --> <rule ref="category/java/codestyle.xml/ForLoopsMustUseBraces" /> <rule ref="category/java/codestyle.xml/IfElseStmtsMustUseBraces" /> <rule ref="category/java/codestyle.xml/IfStmtsMustUseBraces" /> <rule ref="category/java/codestyle.xml/WhileLoopsMustUseBraces" /> <!-- rules previously in rulesets/java/clone.xml --> <rule ref="category/java/errorprone.xml/CloneMethodMustBePublic" /> <rule ref="category/java/errorprone.xml/CloneMethodMustImplementCloneable" /> <rule ref="category/java/errorprone.xml/CloneMethodReturnTypeMustMatchClassName" /> <rule ref="category/java/errorprone.xml/ProperCloneImplementation" /> <!-- rules previously in rulesets/java/controversial.xml --> <rule ref="category/java/errorprone.xml/AssignmentInOperand" /> <rule ref="category/java/errorprone.xml/AvoidAccessibilityAlteration" /> <rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly" /> <rule ref="category/java/errorprone.xml/DontImportSun" /> <rule ref="category/java/errorprone.xml/SuspiciousOctalEscape" /> <rule ref="category/java/codestyle.xml/UnnecessaryConstructor" /> <rule ref="category/java/bestpractices.xml/OneDeclarationPerLine" /> <rule ref="category/java/design.xml/UseObjectForClearerAPI" /> <!-- rules previously in rulesets/java/design.xml --> <rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal" /> <rule ref="category/java/design.xml/FinalFieldCouldBeStatic" /> <rule ref="category/java/design.xml/ImmutableField" /> <rule ref="category/java/design.xml/LogicInversion" /> <rule ref="category/java/design.xml/SimplifyBooleanExpressions" /> <rule ref="category/java/design.xml/SimplifyBooleanReturns" /> <rule ref="category/java/design.xml/SimplifyConditional" /> <rule ref="category/java/design.xml/SingularField" /> <rule ref="category/java/design.xml/SwitchDensity" /> <rule ref="category/java/design.xml/UseUtilityClass" /> <rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic" /> <rule ref="category/java/errorprone.xml/AvoidInstanceofChecksInCatchClause" /> <rule ref="category/java/errorprone.xml/BadComparison" /> <rule ref="category/java/errorprone.xml/CompareObjectsWithEquals" /> <rule ref="category/java/errorprone.xml/EqualsNull" /> <rule ref="category/java/errorprone.xml/IdempotentOperations" /> <rule ref="category/java/errorprone.xml/InstantiationToGetClass" /> <rule ref="category/java/errorprone.xml/MissingBreakInSwitch" /> <rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass" /> <rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement" /> <rule ref="category/java/errorprone.xml/ReturnEmptyArrayRatherThanNull" /> <rule ref="category/java/errorprone.xml/SimpleDateFormatNeedsLocale" /> <rule ref="category/java/errorprone.xml/SingleMethodSingleton" /> <rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance" /> <rule ref="category/java/codestyle.xml/AvoidProtectedFieldInFinalClass" /> <rule ref="category/java/codestyle.xml/AvoidProtectedMethodInFinalClassNotExtending" /> <rule ref="category/java/multithreading.xml/NonThreadSafeSingleton" /> <rule ref="category/java/multithreading.xml/UnsynchronizedStaticDateFormatter" /> <rule ref="category/java/multithreading.xml/UseNotifyAllInsteadOfNotify" /> <rule ref="category/java/bestpractices.xml/AccessorClassGeneration" /> <rule ref="category/java/bestpractices.xml/AccessorMethodGeneration" /> <rule ref="category/java/bestpractices.xml/AvoidReassigningParameters" /> <rule ref="category/java/bestpractices.xml/ConstantsInInterface" /> <rule ref="category/java/bestpractices.xml/DefaultLabelNotLastInSwitchStmt" /> <rule ref="category/java/bestpractices.xml/PositionLiteralsFirstInCaseInsensitiveComparisons" /> <rule ref="category/java/bestpractices.xml/PositionLiteralsFirstInComparisons" /> <rule ref="category/java/bestpractices.xml/PreserveStackTrace" /> <rule ref="category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault" /> <rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty" /> <rule ref="category/java/bestpractices.xml/UseVarargs" /> <rule ref="category/java/performance.xml/OptimizableToArrayCall" /> <rule ref="category/java/performance.xml/TooFewBranchesForASwitchStatement" /> <rule ref="category/java/documentation.xml/UncommentedEmptyConstructor" /> <rule ref="category/java/documentation.xml/UncommentedEmptyMethodBody" /> <rule ref="category/java/errorprone.xml/CloseResource"> <properties> <property name="types" value="Connection,Statement,ResultSet,OutgoingMessageBuilder"/> </properties> </rule> <!-- rules previously in rulesets/java/finalizers.xml --> <rule ref="category/java/errorprone.xml/AvoidCallingFinalize" /> <rule ref="category/java/errorprone.xml/EmptyFinalizer" /> <rule ref="category/java/errorprone.xml/FinalizeDoesNotCallSuperFinalize" /> <rule ref="category/java/errorprone.xml/FinalizeOnlyCallsSuperFinalize" /> <rule ref="category/java/errorprone.xml/FinalizeOverloaded" /> <rule ref="category/java/errorprone.xml/FinalizeShouldBeProtected" /> <!-- rules previously in rulesets/java/imports.xml --> <rule ref="category/java/bestpractices.xml/UnusedImports" /> <rule ref="category/java/errorprone.xml/ImportFromSamePackage" /> <rule ref="category/java/codestyle.xml/DontImportJavaLang" /> <rule ref="category/java/codestyle.xml/DuplicateImports" /> <rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" /> <!-- rules previously in rulesets/java/logging-java.xml --> <rule ref="category/java/errorprone.xml/InvalidSlf4jMessageFormat" /> <rule ref="category/java/errorprone.xml/MoreThanOneLogger" /> <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace" /> <rule ref="category/java/bestpractices.xml/GuardLogStatement" /> <rule ref="category/java/bestpractices.xml/SystemPrintln" /> <!-- rules previously in rulesets/java/migrating.xml --> <rule ref="category/java/errorprone.xml/AvoidAssertAsIdentifier" /> <rule ref="category/java/errorprone.xml/AvoidEnumAsIdentifier" /> <rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach" /> <rule ref="category/java/bestpractices.xml/JUnit4SuitesShouldUseSuiteAnnotation" /> <rule ref="category/java/bestpractices.xml/JUnitUseExpected" /> <rule ref="category/java/bestpractices.xml/ReplaceEnumerationWithIterator" /> <rule ref="category/java/bestpractices.xml/ReplaceHashtableWithMap" /> <rule ref="category/java/bestpractices.xml/ReplaceVectorWithList" /> <rule ref="category/java/performance.xml/ByteInstantiation" /> <rule ref="category/java/performance.xml/IntegerInstantiation" /> <rule ref="category/java/performance.xml/LongInstantiation" /> <rule ref="category/java/performance.xml/ShortInstantiation" /> <!-- rules previously in rulesets/java/migrating.xml --> <rule ref="category/java/performance.xml/AddEmptyString" /> <rule ref="category/java/performance.xml/AvoidArrayLoops" /> <rule ref="category/java/performance.xml/RedundantFieldInitializer" /> <rule ref="category/java/performance.xml/UnnecessaryWrapperObjectCreation" /> <rule ref="category/java/performance.xml/UseArrayListInsteadOfVector" /> <rule ref="category/java/performance.xml/UseArraysAsList" /> <rule ref="category/java/performance.xml/UseStringBufferForStringAppends" /> <!-- rules previously in rulesets/java/strictexception.xml --> <rule ref="category/java/errorprone.xml/AvoidCatchingNPE" /> <rule ref="category/java/errorprone.xml/AvoidLosingExceptionInformation" /> <rule ref="category/java/errorprone.xml/DoNotThrowExceptionInFinally" /> <rule ref="category/java/design.xml/AvoidCatchingGenericException" /> <rule ref="category/java/design.xml/AvoidRethrowingException" /> <rule ref="category/java/design.xml/AvoidThrowingNewInstanceOfSameException" /> <rule ref="category/java/design.xml/AvoidThrowingNullPointerException" /> <rule ref="category/java/design.xml/DoNotExtendJavaLangError" /> <rule ref="category/java/design.xml/ExceptionAsFlowControl" /> <rule ref="category/java/design.xml/SignatureDeclareThrowsException" /> <!-- rules previously in rulesets/java/strings.xml --> <rule ref="category/java/errorprone.xml/StringBufferInstantiationWithChar" /> <rule ref="category/java/errorprone.xml/UnnecessaryCaseChange" /> <rule ref="category/java/errorprone.xml/UseEqualsToCompareStrings" /> <rule ref="category/java/bestpractices.xml/AvoidStringBufferField" /> <rule ref="category/java/performance.xml/AppendCharacterWithChar" /> <rule ref="category/java/performance.xml/ConsecutiveAppendsShouldReuse" /> <rule ref="category/java/performance.xml/InefficientEmptyStringCheck" /> <rule ref="category/java/performance.xml/InefficientStringBuffering" /> <rule ref="category/java/performance.xml/StringInstantiation" /> <rule ref="category/java/performance.xml/StringToString" /> <rule ref="category/java/performance.xml/UseIndexOfChar" /> <rule ref="category/java/performance.xml/UselessStringValueOf" /> <rule ref="category/java/performance.xml/UseStringBufferLength" /> <!-- rules previously in rulesets/java/unusedcode.xml --> <rule ref="category/java/bestpractices.xml/UnusedLocalVariable" /> <rule ref="category/java/bestpractices.xml/UnusedPrivateField" /> </ruleset>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy