-
Notifications
You must be signed in to change notification settings - Fork 57
/
ruleset.xml
78 lines (72 loc) · 2.96 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
<?xml version="1.0"?>
<ruleset name="ObjectCalisthenics">
<!-- 1. Only one indentation level per function/method -->
<rule ref="ObjectCalisthenics.Metrics.MaxNestingLevel">
<properties>
<property name="maxNestingLevel" value="2"/>
</properties>
</rule>
<!-- 2. There is no "else" -->
<rule ref="ObjectCalisthenics.ControlStructures.NoElse"/>
<!-- 5. Only one object operator (->) per line -->
<rule ref="ObjectCalisthenics.CodeAnalysis.OneObjectOperatorPerLine"/>
<!-- 6. Do not abbreviate -->
<rule ref="ObjectCalisthenics.NamingConventions.ClassNameLength">
<properties>
<property name="minLength" value="3"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.NamingConventions.ConstantNameLength">
<properties>
<property name="minLength" value="3"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.NamingConventions.FunctionNameLength">
<properties>
<property name="minLength" value="3"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.NamingConventions.VariableNameLength">
<properties>
<property name="minLength" value="3"/>
<property name="propertiesToBeSkipped" type="array"
value="id"
/>
</properties>
</rule>
<!-- 7. Keep your classes small -->
<rule ref="ObjectCalisthenics.Files.ClassElementLength">
<properties>
<property name="maxLength" value="200"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Metrics.MethodPerClassLimit">
<properties>
<property name="maxLength" value="10"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Metrics.PropertyPerClassLimit">
<properties>
<property name="maxLength" value="10"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Files.FunctionLength">
<properties>
<property name="maxLength" value="20"/>
</properties>
</rule>
<!-- 8. Do Not Use Classes With More Than Two Instance Variables -->
<rule ref="ObjectCalisthenics.CodeAnalysis.InstancePropertyPerClassLimit">
<properties>
<property name="maxCount" value="2"/>
</properties>
</rule>
<!-- 9. Do not Use Getters and Setters -->
<rule ref="ObjectCalisthenics.Classes.ForbiddenPublicProperty">
<properties>
<property name="filesToBeSkipped" type="array"
value="ForbiddenPublicPropertySniff.php,ClassElementLengthSniff.php,FunctionNameLengthSniff.php,AbstractDataStructureLengthSniff.php,MaxNestingLevelSniff.php,FunctionLengthSniff.php,ConstantNameLengthSniff.php,ClassNameLengthSniff.php,VariableNameLengthSniff.php,MethodPerClassLimitSniff.php,PropertyPerClassLimitSniff.php,InstancePropertyPerClassLimitSniff.php,OneObjectOperatorPerLineSniff.php"
/>
</properties>
</rule>
</ruleset>