blob: 39f2caa7cae4aa8989fc996cbaeb2969bbbc7861 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<ruleset name="Apache Commons Imaging PMD ruleset"
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>This PMD ruleset checks Apache Commons Imaging code</description>
<rule ref="rulesets/java/basic.xml">
<!-- Nested if statements can be good for readability -->
<exclude name="CollapsibleIfStatements"/>
</rule>
<rule ref="rulesets/java/braces.xml"/>
<rule ref="rulesets/java/clone.xml"/>
<rule ref="rulesets/java/comments.xml/CommentContent"/>
<rule ref="rulesets/java/controversial.xml/UnnecessaryConstructor"/>
<rule ref="rulesets/java/controversial.xml/AtLeastOneConstructor"/>
<rule ref="rulesets/java/controversial.xml/DontImportSun"/>
<rule ref="rulesets/java/controversial.xml/SuspiciousOctalEscape"/>
<rule ref="rulesets/java/controversial.xml/AvoidUsingVolatile"/>
<rule ref="rulesets/java/controversial.xml/AvoidUsingNativeCode"/>
<rule ref="rulesets/java/controversial.xml/AvoidAccessibilityAlteration"/>
<rule ref="rulesets/java/controversial.xml/DoNotCallGarbageCollectionExplicitly"/>
<rule ref="rulesets/java/controversial.xml/UseObjectForClearerAPI"/>
<rule ref="rulesets/java/design.xml">
<!-- FIXME: we should eventually replace constant interfaces -->
<exclude name="AvoidConstantsInterface"/>
<exclude name="AvoidDeeplyNestedIfStmts"/>
<exclude name="AvoidReassigningParameters"/>
<exclude name="ConfusingTernary"/>
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
<exclude name="GodClass"/>
<!-- PMD seems to want only break, not return -->
<exclude name="MissingBreakInSwitch"/>
<exclude name="ReturnEmptyArrayRatherThanNull"/>
<exclude name="SimplifyBooleanReturns"/>
<exclude name="SwitchStmtsShouldHaveDefault"/>
<exclude name="UnnecessaryLocalBeforeReturn"/>
</rule>
<rule ref="rulesets/java/empty.xml">
<!-- empty if statements are useful to skip actions taken by the else (if(s)) -->
<exclude name="EmptyIfStmt"/>
</rule>
<rule ref="rulesets/java/finalizers.xml"/>
<rule ref="rulesets/java/imports.xml"/>
<rule ref="rulesets/java/migrating.xml"/>
<rule ref="rulesets/java/optimizations.xml">
<exclude name="AvoidInstantiatingObjectsInLoops"/>
<exclude name="RedundantFieldInitializer"/>
<exclude name="PrematureDeclaration"/>
</rule>
<rule ref="rulesets/java/strings.xml">
<exclude name="AvoidDuplicateLiterals"/>
</rule>
<rule ref="rulesets/java/unnecessary.xml">
<!-- Parentheses are useful for grouping subexpressions -->
<exclude name="UselessParentheses"/>
</rule>
<rule ref="rulesets/java/unusedcode.xml"/>
</ruleset>