Conditions | 4 |
Paths | 4 |
Total Lines | 108 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
44 | public function getErrorList($testFile) |
||
45 | { |
||
46 | if ($testFile === 'FunctionCommentUnitTest.1.inc') { |
||
47 | $ret = array( |
||
48 | 5 => 1, |
||
49 | 6 => 1, |
||
50 | 10 => 3, |
||
51 | 12 => 2, |
||
52 | 13 => 2, |
||
53 | 14 => 1, |
||
54 | 15 => 2, // +1 for "excessive @throws" tag. |
||
55 | 28 => 1, |
||
56 | 43 => 1, |
||
57 | 52 => 1, |
||
58 | 76 => 1, |
||
59 | 87 => 1, |
||
60 | 103 => 1, |
||
61 | 109 => 1, |
||
62 | 110 => 1, |
||
63 | 112 => 1, |
||
64 | 122 => 1, |
||
65 | 123 => 3, |
||
66 | 124 => 2, |
||
67 | 125 => 1, |
||
68 | 126 => 1, |
||
69 | 137 => 4, |
||
70 | 138 => 4, |
||
71 | 139 => 4, |
||
72 | 143 => 2, |
||
73 | 152 => 1, |
||
74 | 155 => 2, |
||
75 | 159 => 1, |
||
76 | 166 => 1, |
||
77 | 173 => 1, |
||
78 | 180 => 1, |
||
79 | 183 => 1, |
||
80 | 190 => 2, |
||
81 | 193 => 2, |
||
82 | 196 => 1, |
||
83 | 199 => 3, // +1 for "excessive @throws" tag. |
||
84 | 210 => 1, |
||
85 | 211 => 1, |
||
86 | 222 => 1, |
||
87 | 223 => 1, |
||
88 | 224 => 1, |
||
89 | 225 => 1, |
||
90 | 226 => 1, |
||
91 | 227 => 1, |
||
92 | 230 => 2, |
||
93 | 232 => 2, |
||
94 | 246 => 1, |
||
95 | 248 => 4, |
||
96 | 261 => 1, |
||
97 | 263 => 1, |
||
98 | 276 => 1, |
||
99 | 277 => 1, |
||
100 | 278 => 1, |
||
101 | 279 => 1, |
||
102 | 280 => 1, |
||
103 | 281 => 1, |
||
104 | 284 => 1, |
||
105 | 286 => 7, |
||
106 | 294 => 1, |
||
107 | 302 => 1, |
||
108 | 312 => 1, |
||
109 | 358 => 1, |
||
110 | 359 => 2, |
||
111 | 372 => 1, |
||
112 | 373 => 1, |
||
113 | 387 => 1, |
||
114 | 407 => 1, |
||
115 | 441 => 1, |
||
116 | 500 => 1, |
||
117 | 526 => 1, |
||
118 | 548 => 1, |
||
119 | 641 => 1, |
||
120 | 657 => 1, |
||
121 | ); |
||
122 | |||
123 | return $ret; |
||
124 | } elseif ($testFile === 'FunctionCommentUnitTest.2.inc') { |
||
125 | return array( |
||
126 | // Square bracket not allowed as function short description start. |
||
127 | 7 => 1, |
||
128 | |||
129 | // Square bracket is allowed as event short description start. |
||
130 | 17 => 0, |
||
131 | |||
132 | // Incorrect event short description start. |
||
133 | 27 => 1, |
||
134 | ); |
||
135 | } elseif ($testFile === 'FunctionCommentUnitTest.3.inc') { |
||
136 | $ret = array( |
||
137 | // Square bracket not allowed as function short description start. |
||
138 | 7 => 1, |
||
139 | |||
140 | // Square bracket is allowed as event short description start. |
||
141 | 17 => 0, |
||
142 | |||
143 | // Incorrect event short description start. |
||
144 | 27 => 1, |
||
145 | ); |
||
146 | |||
147 | return $ret; |
||
148 | }//end if |
||
149 | |||
150 | return array(); |
||
151 | }//end getErrorList() |
||
152 | |||
169 |