source: josm/trunk/tools/pmd/josm-ruleset.xml @ 12542

Last change on this file since 12542 was 12542, checked in by Don-vip, 21 months ago

partial revert of r12537

File size: 5.3 KB
Line 
1<?xml version="1.0"?>
2<ruleset name="JOSM ruleset"
3    xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
4    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5    xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
6 
7  <description>JOSM PMD ruleset</description>
8 
9  <!-- <rule ref="rulesets/java/basic.xml"/>
10  <rule ref="rulesets/java/braces.xml"/>
11  <rule ref="rulesets/java/clone.xml"/>
12  <rule ref="rulesets/java/codesize.xml"/>
13  <rule ref="rulesets/java/comments.xml"/>
14  <rule ref="rulesets/java/design.xml"/>
15  <rule ref="rulesets/java/empty.xml"/>
16  <rule ref="rulesets/java/finalizers.xml"/>
17  <rule ref="rulesets/java/imports.xml"/>
18  <rule ref="rulesets/java/migrating.xml"/>-->
19  <rule ref="rulesets/java/naming.xml">
20        <exclude name="AbstractNaming"/>
21        <exclude name="AvoidFieldNameMatchingMethodName"/>
22        <exclude name="AvoidFieldNameMatchingTypeName"/>
23        <exclude name="BooleanGetMethodName"/>
24        <exclude name="LongVariable"/>
25        <exclude name="ShortClassName"/>
26        <exclude name="ShortMethodName"/>
27        <exclude name="ShortVariable"/>
28        <exclude name="MethodNamingConventions"/>
29        <exclude name="VariableNamingConventions"/>
30  </rule>
31  <rule ref="rulesets/java/naming.xml/ShortMethodName">
32    <properties>
33        <property name="violationSuppressXPath" value="//MethodDeclarator[@Image='at' or @Image='ht' or @Image='of' or @Image='ok' or @Image='tr']
34                | //MethodDeclarator/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated']
35                | //MethodDeclarator/../../../..[@Image='LambertConformalConic']"/>
36    </properties>
37  </rule>
38  <rule ref="rulesets/java/naming.xml/MethodNamingConventions">
39    <properties>
40        <property name="violationSuppressXPath" value="//MethodDeclarator/../../../..[@Image='Functions' or @Image='PseudoClasses' or @Image='Role' or @Image='TaggingPreset']"/>
41    </properties>
42  </rule>
43  <rule ref="rulesets/java/naming.xml/VariableNamingConventions">
44    <properties>
45        <property name="violationSuppressXPath" value="//FieldDeclaration[@Public='true']
46                | //FieldDeclaration/../Annotation/MarkerAnnotation/Name[@Image='pref']
47                | //FieldDeclaration/Type/ReferenceType/ClassOrInterfaceType[@Image!='Boolean' and
48                                                                             @Image!='Byte' and
49                                                                             @Image!='Character' and
50                                                                             @Image!='Class' and
51                                                                             @Image!='Double' and
52                                                                             @Image!='Enum' and
53                                                                             @Image!='Float' and
54                                                                             @Image!='Integer' and
55                                                                             @Image!='Long' and
56                                                                             @Image!='Number' and
57                                                                             @Image!='Short' and
58                                                                             @Image!='String' ]"/>
59    </properties>
60  </rule>
61  <rule ref="rulesets/java/naming.xml/LongVariable">
62    <properties>
63        <property name="minimum" value="44"/>
64    </properties>
65  </rule>
66  <rule ref="rulesets/java/optimizations.xml">
67        <exclude name="LocalVariableCouldBeFinal"/>
68        <exclude name="MethodArgumentCouldBeFinal"/>
69        <exclude name="AvoidInstantiatingObjectsInLoops"/>
70        <exclude name="PrematureDeclaration"/>
71        <exclude name="SimplifyStartsWith"/>
72        <exclude name="UseStringBufferForStringAppends"/>
73        <exclude name="UseArrayListInsteadOfVector"/>
74  </rule>
75  <rule ref="rulesets/java/strictexception.xml">
76        <exclude name="ExceptionAsFlowControl"/>
77        <exclude name="AvoidCatchingGenericException"/>
78        <exclude name="AvoidRethrowingException"/>
79  </rule>
80  <rule ref="rulesets/java/strings.xml">
81        <exclude name="AvoidDuplicateLiterals"/>
82        <exclude name="ConsecutiveLiteralAppends"/>
83        <exclude name="AvoidStringBufferField"/>
84        <exclude name="StringToString"/>
85        <exclude name="UselessStringValueOf"/>
86        <exclude name="InefficientEmptyStringCheck"/>
87  </rule>
88  <rule ref="rulesets/java/typeresolution.xml">
89        <exclude name="LooseCoupling"/>
90        <exclude name="SignatureDeclareThrowsException"/>
91  </rule>
92  <rule ref="rulesets/java/typeresolution.xml/SignatureDeclareThrowsException">
93    <properties>
94        <property name="violationSuppressXPath" value="//MethodDeclaration/../Annotation/MarkerAnnotation/Name[@Image='Override']"/>
95        <property name="IgnoreJUnitCompletely" value="true"/>
96    </properties>
97  </rule>
98  <rule ref="rulesets/java/unnecessary.xml">
99        <exclude name="UselessParentheses"/>
100        <exclude name="UselessOverridingMethod"/>
101  </rule>
102  <rule ref="rulesets/java/unusedcode.xml">
103        <exclude name="UnusedFormalParameter"/>
104  </rule>
105  <rule ref="rulesets/java/unusedcode.xml/UnusedFormalParameter">
106    <properties>
107        <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@Image='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/>
108    </properties>
109  </rule>
110
111</ruleset>
Note: See TracBrowser for help on using the repository browser.