pmd-rules.xml (1773B)
1 <?xml version="1.0"?> 2 <!-- This Source Code Form is subject to the terms of the Mozilla Public 3 - License, v. 2.0. If a copy of the MPL was not distributed with this 4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 5 6 <ruleset name="Custom ruleset" 7 xmlns="http://pmd.sf.net/ruleset/1.0.0" 8 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 9 xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd" 10 xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"> 11 12 <description>Focus Android Ruleset</description> 13 14 <rule ref="rulesets/java/basic.xml"/> 15 <rule ref="rulesets/java/braces.xml"/> 16 <rule ref="rulesets/java/clone.xml"/> 17 <rule ref="rulesets/java/codesize.xml"/> 18 19 <!-- We'll use the entire 'strings' ruleset --> 20 <rule ref="rulesets/java/strings.xml"/> 21 22 <!-- Here's some rules we'll specify one at a time --> 23 <rule ref="rulesets/java/unusedcode.xml/UnusedLocalVariable"/> 24 <rule ref="rulesets/java/unusedcode.xml/UnusedPrivateField"/> 25 <rule ref="rulesets/java/unusedcode.xml/UnusedPrivateMethod"/> 26 <rule ref="rulesets/java/imports.xml/DuplicateImports"/> 27 <rule ref="rulesets/java/unnecessary.xml/UnnecessaryConversionTemporary"/> 28 29 <!-- We want to customize this rule a bit, change the message and raise the priority --> 30 <rule 31 message="Must handle exceptions" 32 ref="rulesets/java/empty.xml/EmptyCatchBlock"> 33 <priority>2</priority> 34 </rule> 35 36 <!-- Now we'll customize a rule's property value --> 37 <rule ref="rulesets/java/codesize.xml/CyclomaticComplexity"> 38 <properties> 39 <property name="reportLevel" value="5"/> 40 </properties> 41 </rule> 42 </ruleset>