-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ruleset.xml
More file actions
94 lines (84 loc) · 4.08 KB
/
test.ruleset.xml
File metadata and controls
94 lines (84 loc) · 4.08 KB
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
<?xml version="1.0"?>
<ruleset name="emu-test-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 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>Emu ruleset for testing code</description>
<rule ref="category/java/bestpractices.xml">
<!-- Avoid reporting pedantic tests -->
<exclude name="UnitTestContainsTooManyAsserts" />
</rule>
<rule ref="category/java/codestyle.xml">
<!-- Avoid reporting variables with a short name -->
<exclude name="ShortVariable" />
<!-- Avoid reporting test classes without constructors -->
<exclude name="AtLeastOneConstructor" />
<!-- Avoid reporting class names not declared in camel case -->
<exclude name="ClassNamingConventions" />
<!-- Avoid reporting field name not declared in camel case -->
<exclude name="FieldNamingConventions" />
<!-- Avoid reporting method names not declared in camel case -->
<exclude name="MethodNamingConventions" />
<!-- Avoid reporting variables not declared in camel case -->
<exclude name="LocalVariableNamingConventions" />
<!-- Avoid reporting method/lambda parameters not declared in camel case -->
<exclude name="FormalParameterNamingConventions" />
<!-- Avoid reporting methods and fields with "confusing" names -->
<exclude name="LinguisticNaming" />
</rule>
<!-- Avoid reporting variables with a long name -->
<rule ref="category/java/codestyle.xml/LongVariable">
<properties>
<property name="minimum" value="30" />
</properties>
</rule>
<rule ref="category/java/design.xml">
<!-- Avoid reporting classes with too many imports -->
<exclude name="ExcessiveImports" />
<!-- Avoid reporting usage of classes from outside the package hierarchy -->
<exclude name="LoosePackageCoupling" />
<!-- Avoid reporting usage of data coming from "too far away" -->
<exclude name="LawOfDemeter" />
<!-- Avoid reporting big test files -->
<exclude name="TooManyMethods" />
<!-- Avoid reporting methods that are "too complex" -->
<exclude name="CognitiveComplexity" />
<!-- Avoid reporting methods that are "too complex" -->
<exclude name="CyclomaticComplexity" />
<!-- Avoid reporting methods that are "too complex" -->
<exclude name="NPathComplexity" />
</rule>
<rule ref="category/java/documentation.xml">
<!-- Avoid reporting comments with too many lines -->
<exclude name="CommentSize" />
<!-- Avoid reporting missing comments on private fields -->
<exclude name="CommentRequired" />
</rule>
<rule ref="category/java/errorprone.xml">
<!-- Avoid reporting methods with the same name of a field -->
<exclude name="AvoidFieldNameMatchingMethodName" />
<!-- Avoid reporting the usage of null in test setup -->
<exclude name="NullAssignment" />
</rule>
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals">
<properties>
<property name="maxDuplicateLiterals" value="5" />
<property name="minimumLength" value="3" />
<property name="skipAnnotations" value="true" />
<property name="exceptionList" value="" />
</properties>
</rule>
<rule ref="category/java/multithreading.xml">
<!-- Avoid reporting anything related to java.lang.Thread or Executors -->
<exclude name="DoNotUseThreads" />
</rule>
<rule ref="category/java/performance.xml">
<!-- Avoid reporting redundant field initialization -->
<exclude name="RedundantFieldInitializer" />
<!-- Avoid reporting "slow" string appends in tests -->
<exclude name="UseStringBufferForStringAppends" />
<!-- Avoid reporting object creations in loops -->
<exclude name="AvoidInstantiatingObjectsInLoops" />
</rule>
<rule ref="category/java/security.xml" />
</ruleset>