Skip to content

Commit 665c4c1

Browse files
committed
bump thresholds for SmallClass sniffs (200 LOC/class, 25 LOC/method)
1 parent eb40b31 commit 665c4c1

File tree

4 files changed

+105
-14
lines changed

4 files changed

+105
-14
lines changed

Sniffs/ObjectCalisthenics/SmallClassSniff/NodeVisitor.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ class Symfony2_Sniffs_ObjectCalisthenics_SmallClassSniff_NodeVisitor extends PHP
1212
private $metaData = array(
1313
'Stmt_Class' => array(
1414
'keyword' => 'class',
15-
'maximum' => 100,
15+
'maximum' => 200,
1616
),
1717
'Stmt_Interface' => array(
1818
'keyword' => 'interface',
19-
'maximum' => 100,
19+
'maximum' => 200,
2020
),
2121
'Stmt_Trait' => array(
2222
'keyword' => 'trait',
23-
'maximum' => 100,
23+
'maximum' => 200,
2424
),
2525
'Stmt_ClassMethod' => array(
2626
'keyword' => 'method',
27-
'maximum' => 10,
27+
'maximum' => 25,
2828
),
2929
);
3030

Tests/ObjectCalisthenics/SmallClassUnitTest.inc

+100
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ class SmallClassSniffTest
2020
*
2121
*
2222
*
23+
*
24+
*
25+
*
26+
*
27+
*
28+
*
29+
*
30+
*
31+
*
32+
*
33+
*
34+
*
35+
*
36+
*
37+
*
2338
*/
2439
}
2540

@@ -75,6 +90,61 @@ class SmallClassSniffTest
7590
*
7691
*
7792
*
93+
*
94+
*
95+
*
96+
*
97+
*
98+
*
99+
*
100+
*
101+
*
102+
*
103+
*
104+
*
105+
*
106+
*
107+
*
108+
*
109+
*
110+
*
111+
*
112+
*
113+
*
114+
*
115+
*
116+
*
117+
*
118+
*
119+
*
120+
*
121+
*
122+
*
123+
*
124+
*
125+
*
126+
*
127+
*
128+
*
129+
*
130+
*
131+
*
132+
*
133+
*
134+
*
135+
*
136+
*
137+
*
138+
*
139+
*
140+
*
141+
*
142+
*
143+
*
144+
*
145+
*
146+
*
147+
*
78148
*/
79149
public function smallMethodBigDocBlock()
80150
{
@@ -87,6 +157,21 @@ class SmallClassSniffTest
87157
*
88158
*
89159
*
160+
*
161+
*
162+
*
163+
*
164+
*
165+
*
166+
*
167+
*
168+
*
169+
*
170+
*
171+
*
172+
*
173+
*
174+
*
90175
*/
91176
}
92177

@@ -105,6 +190,21 @@ class SmallClassSniffTest
105190
*
106191
*
107192
*
193+
*
194+
*
195+
*
196+
*
197+
*
198+
*
199+
*
200+
*
201+
*
202+
*
203+
*
204+
*
205+
*
206+
*
207+
*
108208
*/
109209
}
110210
}

Tests/ObjectCalisthenics/SmallClassUnitTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getWarningList()
5353
{
5454
return array(
5555
7 => 1,
56-
96 => 1,
56+
181 => 1,
5757
);
5858
}
5959
}

ruleset.xml

-9
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,4 @@
8686
<rule ref="Symfony2.Commenting.ClassComment.SpacingBeforeTags">
8787
<message>There should always be a description, followed by a blank line, before the tags of a class comment.</message>
8888
</rule>
89-
90-
<!-- Disable these object calisthenic sniffs -->
91-
<rule ref="Symfony2.ObjectCalisthenics.SmallClass">
92-
<severity>0</severity>
93-
</rule>
94-
95-
<rule ref="Symfony2.ObjectCalisthenics.UseAccessors">
96-
<severity>0</severity>
97-
</rule>
9889
</ruleset>

0 commit comments

Comments
 (0)