forked from fair-acc/chart-fx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruleset.xml
103 lines (95 loc) · 4.35 KB
/
ruleset.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="UTF-8"?>
<ruleset 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" name="CSCOAP PMD Rules">
<description>PMD rules for CSCOAP at GSI Java Applications</description>
<!-- see https://pmd.github.io/pmd-6.3.0/pmd_rules_java.html -->
<!-- tested with pmd-6.3.0 -->
<!-- exclude files that are generated -->
<exclude-pattern>.*\/generated-sources\/.*</exclude-pattern>
<!-- excludes tests -->
<exclude-pattern>.*\/src\/test\/.*</exclude-pattern>
<!-- excludes target -->
<exclude-pattern>.*\/target\/.*</exclude-pattern>
<rule ref="category/java/bestpractices.xml">
<exclude name="SystemPrintln"/> <!-- system out only tolerated for example sub-project -->
<exclude name="GuardLogStatement"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
<exclude name="UseVarargs"/>
<exclude name="UnusedImports"/> <!-- re-enable once Codacy moved to new version -->
</rule>
<rule ref="category/java/documentation.xml">
<exclude name="CommentRequired"/>
</rule>
<rule ref="category/java/documentation.xml/CommentSize">
<properties>
<property name="maxLines" value="1000" /> <!-- do not limit code-based documentation -->
<property name="maxLineLength" value="200" />
</properties>
</rule>
<rule ref="category/java/bestpractices.xml/JUnitTestContainsTooManyAsserts">
<properties>
<property name="maximumAsserts" value="10"/>
</properties>
</rule>
<rule ref="category/java/multithreading.xml">
<!--Rule disabled - This is not a J2EE project.-->
<exclude name="DoNotUseThreads"/>
</rule>
<rule ref="category/java/codestyle.xml">
<exclude name="AtLeastOneConstructor"/>
<exclude name="AvoidFinalLocalVariable"/>
<exclude name="LocalVariableCouldBeFinal"/>
<exclude name="LongVariable"/>
<exclude name="MethodArgumentCouldBeFinal"/>
<exclude name="OnlyOneReturn"/>
<exclude name="PackageCase"/>
<exclude name="PrematureDeclaration"/>
<exclude name="ShortVariable"/>
<exclude name="ShortClassName"/>
<exclude name="UnnecessaryLocalBeforeReturn"/>
<exclude name="UselessParentheses"/>
<exclude name="LinguisticNaming"/> <!-- allow factory setter methods to return itself (fluent-design) -->
</rule>
<rule ref="category/java/codestyle.xml/PrematureDeclaration">
<properties>
<property name="violationSuppressRegex" value=".*MakeRule.*"/>
</properties>
</rule>
<rule ref="category/java/design.xml">
<exclude name="LawOfDemeter"/>
<exclude name="CyclomaticComplexity"/>
<exclude name="StdCyclomaticComplexity"/> <!-- deprecated, will be removed in 7.0.0 -->
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="AssignmentInOperand"/>
<exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="EmptyCatchBlock"/>
<exclude name="NonStaticInitializer"/>
<!-- suppressed since implementation is erroneous and also for the vast majority of non-serialisable classes -->
<exclude name="BeanMembersShouldSerialize"/>
</rule>
<rule ref="category/java/errorprone.xml/AssignmentInOperand">
<properties>
<property name="allowIncrementDecrement" value="true"/>
<property name="allowWhile" value="true"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
<properties>
<property name="ignoreMagicNumbers" value="-1,0,1,2,-1.0,0.0,1.0,2.0"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/EmptyCatchBlock">
<properties>
<property name="allowCommentedBlocks" value="true"/>
</properties>
</rule>
<rule ref="category/java/performance.xml">
<exclude name="AvoidInstantiatingObjectsInLoops"/>
<exclude name="SimplifyStartsWith"/>
</rule>
<rule ref="category/java/performance.xml/AvoidInstantiatingObjectsInLoops">
<priority>5</priority>
</rule>
</ruleset>