/
ruleset.xml
52 lines (41 loc) · 2.24 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
<?xml version="1.0"?>
<ruleset name="ObjectCalisthenics">
<description>Object Calisthenics coding standard.</description>
<!-- Import PSR-2 coding standard (base) -->
<rule ref="PSR2"/>
<!-- Rule #1: Only one indentation level per function/method -->
<rule ref="ObjectCalisthenics.Metrics.OneIndentationLevel"/>
<!-- Rule #2: There is no "else" -->
<rule ref="ObjectCalisthenics.ControlStructures.NoElse"/>
<!-- Rule #3: Encapsulate all primitive types and strings -->
<!-- Cannot be implemented, since it requires to be encapsulated ONLY if they have behavior -->
<!-- Rule #4: Only one object operator (->) per line -->
<rule ref="ObjectCalisthenics.CodeAnalysis.OneObjectOperatorPerLine"/>
<!-- Rule #5: Do not abbreviate -->
<rule ref="ObjectCalisthenics.NamingConventions.VariableLength"/>
<rule ref="ObjectCalisthenics.NamingConventions.FunctionLength"/>
<rule ref="ObjectCalisthenics.NamingConventions.ConstantLength"/>
<rule ref="ObjectCalisthenics.NamingConventions.ClassLength"/>
<!-- Rule #6: Keep your classes small -->
<!-- 15 classes per namespace -->
<!-- Cannot be implemented, since PHPCS can only be executed over files -->
<!-- 200 LOC for interfaces, classes and traits -->
<rule ref="ObjectCalisthenics.Files.InterfaceLength"/>
<rule ref="ObjectCalisthenics.Files.ClassLength"/>
<rule ref="ObjectCalisthenics.Files.TraitLength"/>
<!-- 10 methods per class -->
<rule ref="ObjectCalisthenics.Metrics.MethodPerClassLimit"/>
<!-- 20 LOC for methods -->
<rule ref="ObjectCalisthenics.Files.FunctionLength"/>
<!-- Rule #7: Limit the number of object instances per class (2 to 5) -->
<rule ref="ObjectCalisthenics.CodeAnalysis.InstancePropertyPerClassLimit"/>
<!-- Rule #8: Use first class Collections -->
<rule ref="ObjectCalisthenics.CodeAnalysis.ArrayPropertyPerClassLimit"/>
<!-- Rule #9: Use getters/setter -->
<rule ref="ObjectCalisthenics.Classes.PropertyVisibility"/>
<!-- Rule #10: Document your code -->
<rule ref="Squiz.Commenting.DocCommentAlignment"/>
<!--rule ref="Squiz.Commenting.ClassComment"/-->
<rule ref="Squiz.Commenting.VariableComment"/>
<rule ref="Squiz.Commenting.FunctionComment"/>
</ruleset>