<?xml version="1.0"?>
<!--
  ~ Copyright (C) 2017-2021 HERE Europe B.V.
  ~
  ~ 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.
  -->

<ruleset name="MSDKUI"
    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">

    <rule ref="category/java/bestpractices.xml">
        <exclude name="AbstractClassWithoutAbstractMethod" />
        <exclude name="JUnit4TestShouldUseBeforeAnnotation" />
        <exclude name="JUnit4TestShouldUseTestAnnotation" />
        <exclude name="JUnitTestsShouldIncludeAssert" />
        <exclude name="JUnitAssertionsShouldIncludeMessage"/>
        <exclude name="JUnitTestContainsTooManyAsserts"/>
        <exclude name="JUnitTestsShouldIncludeAssert"/>
    </rule>

    <rule ref="category/java/codestyle.xml/DontImportJavaLang" />
    <rule ref="category/java/codestyle.xml/DuplicateImports" />
    <rule ref="category/java/codestyle.xml/ExtendsObject" />
    <rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
    <rule ref="category/java/codestyle.xml/TooManyStaticImports">
        <properties>
            <property name="maximumStaticImports" value="11"/>
        </properties>
    </rule>
    <rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
    <rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
    <rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
    <rule ref="category/java/codestyle.xml/UselessParentheses" />
    <rule ref="category/java/codestyle.xml/UselessQualifiedThis" />

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

    <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/EmptyCatchBlock" />
    <rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
    <rule ref="category/java/errorprone.xml/EmptyIfStmt" />
    <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/EmptySwitchStatements" />
    <rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
    <rule ref="category/java/errorprone.xml/EmptyTryBlock" />
    <rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
    <rule ref="category/java/errorprone.xml/ImportFromSamePackage" />
    <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/errorprone.xml/UnnecessaryConversionTemporary" />
    <rule ref="category/java/errorprone.xml/UnusedNullCheckInEquals" />
    <rule ref="category/java/errorprone.xml/UselessOperationOnImmutable" />

    <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/performance.xml/BigIntegerInstantiation" />
    <rule ref="category/java/performance.xml/BooleanInstantiation" />

</ruleset>