Adobe-Consulting-Services/acs-aem-commons

View on GitHub
.codeclimate/pmd-ruleset.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<ruleset name="ACS 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 ruleset defines common coding rules used in ACS AEM Commons. It is based on https://github.com/Adobe-Consulting-Services/coding-standards/blob/master/pmd/rules.xml,
        but updated to be compatible with the version of PMD used by codeclimate.
    </description>

    
    <!-- rules from basic ruleset -->
    <rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
    <rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor" />
    <rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators" />
    <rule ref="category/java/errorprone.xml/AvoidUsingOctalValues" />
    <rule ref="category/java/errorprone.xml/BrokenNullCheck" />
    <rule ref="category/java/errorprone.xml/CheckSkipResult" />
    <rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
    <rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
    <rule ref="category/java/errorprone.xml/JumbledIncrementer" />
    <rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
    <rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
    <rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock" />
    <rule ref="category/java/errorprone.xml/UnconditionalIfStatement" />

    <rule ref="category/java/multithreading.xml/AvoidThreadGroup" />
    <rule ref="category/java/multithreading.xml/DontCallThreadRun" />
    <rule ref="category/java/multithreading.xml/DoubleCheckedLocking" />

    <rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
    <rule ref="category/java/bestpractices.xml/CheckResultSet" />

    <rule ref="category/java/codestyle.xml/ExtendsObject" />
    <rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />

    <rule ref="category/java/performance.xml/BigIntegerInstantiation" />
    <rule ref="category/java/performance.xml/BooleanInstantiation" />

    <rule ref="category/java/design.xml/CollapsibleIfStatements" />
    <rule ref="category/java/design.xml/SimplifiedTernary" />

    <!-- rules from logging-java -->
    <rule ref="category/java/errorprone.xml/InvalidSlf4jMessageFormat" />
    <rule ref="category/java/errorprone.xml/LoggerIsNotStaticFinal" />
    <rule ref="category/java/errorprone.xml/MoreThanOneLogger" />

    <rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace" />
    <rule ref="category/java/bestpractices.xml/SystemPrintln" />
</ruleset>