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

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

see #15315 - disable AvoidCatchingNPE

File size: 5.4 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="AvoidCatchingNPE"/>
79        <exclude name="AvoidRethrowingException"/>
80  </rule>
81  <rule ref="rulesets/java/strings.xml">
82        <exclude name="AvoidDuplicateLiterals"/>
83        <exclude name="ConsecutiveLiteralAppends"/>
84        <exclude name="AvoidStringBufferField"/>
85        <exclude name="StringToString"/>
86        <exclude name="UselessStringValueOf"/>
87        <exclude name="InefficientEmptyStringCheck"/>
88  </rule>
89  <rule ref="rulesets/java/typeresolution.xml">
90        <exclude name="LooseCoupling"/>
91        <exclude name="SignatureDeclareThrowsException"/>
92  </rule>
93  <rule ref="rulesets/java/typeresolution.xml/SignatureDeclareThrowsException">
94    <properties>
95        <property name="violationSuppressXPath" value="//MethodDeclaration/../Annotation/MarkerAnnotation/Name[@Image='Override']"/>
96        <property name="IgnoreJUnitCompletely" value="true"/>
97    </properties>
98  </rule>
99  <rule ref="rulesets/java/unnecessary.xml">
100        <exclude name="UselessParentheses"/>
101        <exclude name="UselessOverridingMethod"/>
102  </rule>
103  <rule ref="rulesets/java/unusedcode.xml">
104        <exclude name="UnusedFormalParameter"/>
105  </rule>
106  <rule ref="rulesets/java/unusedcode.xml/UnusedFormalParameter">
107    <properties>
108        <property name="violationSuppressXPath" value="//Annotation[MarkerAnnotation/Name/@Image='Deprecated']/..[MethodDeclaration|ConstructorDeclaration]"/>
109    </properties>
110  </rule>
111
112</ruleset>
Note: See TracBrowser for help on using the repository browser.