-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdefault-config.groovy
106 lines (101 loc) · 3.54 KB
/
default-config.groovy
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
104
105
106
//noinspection GroovyAssignabilityCheck
config {
input '/home/artur/Repos/kanbin'
output '/home/artur/test/stuff.xml'
filters {
filter '.*/test/.*,.*/resources/.*'
filter '.*Test.java'
}
metrics(['wmc', 'atfd', 'tcc']) // not yet supported, need to be configured through MetricFacadeBuilder
jars(['/home/artur/Repos/SmartSmells/src/test/resources/detector.jar']) // additional detectors, see detector-template project
detectors {
detector('brainmethod') { // centralizes the intelligence of a class
let('active', 'true')
}
detector('classdatashouldbeprivate') { // violates data hiding principle
let('active', 'true')
}
detector('comment') {
// loose comments or comments over private members -> naming should be meaningful -> no doc needed
let('active', 'false')
}
detector('complexcondition') { // complexity based on number of '&&' and '||' expressions
let('active', 'true')
let('threshold', '3')
}
detector('complexmethod') { // complexity based on McCabe
let('active', 'true')
let('threshold', '10')
}
detector('cycle') { // direct cycles -> A uses B, B uses A
let('active', 'true')
}
detector('dataclass') { // classes with only attributes, getter, setters, hashcode, equals, compareTo methods
let('active', 'true')
}
detector('deadcode') { // private unused members
let('active', 'true')
}
detector('featureenvy') {
// uses the feature envy factor method by Kwankamol Nongpong -> http://ieeexplore.ieee.org/document/7051460/
let('active', 'true')
let('ignoreStatic', 'true')
// static methods are often just plain utility methods which make extended use in parameters
let('threshold', '0.52') // the feature envy factor threshold, 0.52 is based on experience
let('base', '0.5')
let('weight', '0.5')
}
detector('godclass') {
let('active', 'true')
let('wmc', '47') // weighted method count -> McCabe for all methods
let('atfd', '5') // access to foreign data -> usage of other classes
let('tcc', '0.33') // tied class cohesion -> are own attributes used in methods?
}
detector('javadoc') { // are public members documented? parameter, throw and return tags too?
let('active', 'false')
let('onlyInterfaces', 'true')
}
detector('largeclass') {
let('active', 'true')
let('threshold', '150') // logical length without comments, newlines, package and import statements
}
detector('longmethod') {
let('active', 'true')
let('threshold', '20') // length of a method without headers
}
detector('longparameterlist') {
let('active', 'true')
let('threshold', '5') // length of parameters in methods/constructors
}
detector('middleman') {
let('active', 'true')
let('threshold', 'half') //of methods are delegates [third|half|all]
}
detector('messagechain') {
let('active', 'true')
let('threshold', '3') // at which chain length?
}
detector('nestedblockdepth') {
let('active', 'true')
let('threshold', '3') // depth of statement nesting
}
detector('shotgunsurgery') {
let('active', 'true')
let('cc', '5') // class calls
let('cm', '10') // method calls
}
detector('statechecking') { // conditional blocks for extreme type or constant checking
let('active', 'true')
}
detector('traditionbreaker') { // doesn't use protected members of the parent, declares too many new services
let('active', 'true')
}
detector('refusedparentbequest') { // doesn't use protected members, doesn't override parent methods
let('active', 'true')
}
detector('metrics') {
let('active', 'false')
let('skipCC_CM', 'true')
}
}
}