<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!--
PMD Configuration
Severity: HARD
-->
<ruleset name="PMD ruleset for Checkstyle"
	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>POM rule set file</description>

	<rule ref="rulesets/java/android.xml"/>

	<rule ref="rulesets/java/basic.xml">
		<exclude name="SimplifiedTernary" />
	</rule>

	<rule ref="rulesets/java/clone.xml"/>

	<rule ref="rulesets/java/codesize.xml"/>
	<rule ref="rulesets/java/codesize.xml/CyclomaticComplexity">
		<properties>
			<property name="reportLevel" value="20"/>
		</properties>
	</rule>
	<rule ref="rulesets/java/codesize.xml/TooManyMethods">
		<properties>
			<property name="maxmethods" value="25"/>
		</properties>
	</rule>

	<rule ref="rulesets/java/comments.xml">
		<exclude name="CommentRequired"/>
		<exclude name="CommentSize"/>
		<exclude name="CommentDefaultAccessModifier" />
	</rule>

	<rule ref="rulesets/java/controversial.xml">
		<exclude name="AssignmentInOperand"/>
		<exclude name="AtLeastOneConstructor"/>
		<exclude name="AvoidLiteralsInIfCondition"/>
		<exclude name="AvoidPrefixingMethodParameters"/>
		<exclude name="DataflowAnomalyAnalysis"/>
		<exclude name="DefaultPackage"/>
		<exclude name="NullAssignment"/>
		<exclude name="OnlyOneReturn"/>
	</rule>

	<rule ref="rulesets/java/coupling.xml">
		<exclude name="ExcessiveImports"/>
		<exclude name="LawOfDemeter"/>
		<exclude name="LoosePackageCoupling"/>
	</rule>

	<rule ref="rulesets/java/design.xml">
		<exclude name="AvoidReassigningParameters"/>
		<!-- if (x != y) { short code block } else { long code block } -->
		<exclude name="ConfusingTernary"/>
		<exclude name="SwitchStmtsShouldHaveDefault"/>
		<!-- Android listeners contain a lot of such switch statements -->
		<exclude name="TooFewBranchesForASwitchStatement"/>
		<exclude name="ConstructorCallsOverridableMethod"/>
		<exclude name="MissingBreakInSwitch"/>
		<exclude name="FieldDeclarationsShouldBeAtStartOfClass"/>
		<exclude name="AccessorMethodGeneration" />
	</rule>

	<rule ref="rulesets/java/empty.xml"/>

	<rule ref="rulesets/java/finalizers.xml"/>

	<rule ref="rulesets/java/imports.xml">
		<exclude name="TooManyStaticImports"/>
	</rule>

	<rule ref="rulesets/java/junit.xml">
		<exclude name="JUnitAssertionsShouldIncludeMessage"/>
		<exclude name="JUnitTestContainsTooManyAsserts"/>
		<exclude name="JUnitTestsShouldIncludeAssert" />
	</rule>

	<rule ref="rulesets/java/logging-jakarta-commons.xml">
		<exclude name="GuardLogStatement"/>
	</rule>

	<rule ref="rulesets/java/logging-java.xml">
		<exclude name="GuardLogStatementJavaUtil"/>
	</rule>

	<rule ref="rulesets/java/migrating.xml"/>

	<rule ref="rulesets/java/naming.xml">
		<exclude name="AbstractNaming"/>
		<exclude name="AvoidFieldNameMatchingMethodName"/>
		<exclude name="LongVariable"/>
		<exclude name="MisleadingVariableName"/>
		<exclude name="ShortClassName"/>
		<exclude name="ShortVariable"/>
		<exclude name="VariableNamingConventions"/>
		<exclude name="MethodNamingConventions"/>
		<exclude name="GenericsNaming"/>
	</rule>

	<rule ref="rulesets/java/optimizations.xml">
		<exclude name="AvoidInstantiatingObjectsInLoops"/>
		<exclude name="LocalVariableCouldBeFinal"/>
		<exclude name="MethodArgumentCouldBeFinal"/>
	</rule>

	<rule ref="rulesets/java/strings.xml">
		<exclude name="AvoidDuplicateLiterals"/>
	</rule>

	<rule ref="rulesets/java/typeresolution.xml">
		<exclude name="LooseCoupling"/>
	</rule>

	<rule ref="rulesets/java/unnecessary.xml">
		<exclude name="UselessQualifiedThis" />
	</rule>

	<rule ref="rulesets/java/unusedcode.xml"/>

</ruleset>
