| Conditions | 1 |
| Paths | 1 |
| Total Lines | 107 |
| Code Lines | 105 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 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 |
||
| 152 | protected function ruleUncountable(): array |
||
| 153 | { |
||
| 154 | return [ |
||
| 155 | 'adulthood', |
||
| 156 | 'advice', |
||
| 157 | 'agenda', |
||
| 158 | 'aid', |
||
| 159 | 'aircraft', |
||
| 160 | 'alcohol', |
||
| 161 | 'ammo', |
||
| 162 | 'analytics', |
||
| 163 | 'anime', |
||
| 164 | 'athletics', |
||
| 165 | 'audio', |
||
| 166 | 'bison', |
||
| 167 | 'blood', |
||
| 168 | 'bream', |
||
| 169 | 'buffalo', |
||
| 170 | 'butter', |
||
| 171 | 'carp', |
||
| 172 | 'cash', |
||
| 173 | 'chassis', |
||
| 174 | 'chess', |
||
| 175 | 'clothing', |
||
| 176 | 'cod', |
||
| 177 | 'commerce', |
||
| 178 | 'cooperation', |
||
| 179 | 'corps', |
||
| 180 | 'debris', |
||
| 181 | 'diabetes', |
||
| 182 | 'digestion', |
||
| 183 | 'elk', |
||
| 184 | 'energy', |
||
| 185 | 'equipment', |
||
| 186 | 'excretion', |
||
| 187 | 'expertise', |
||
| 188 | 'firmware', |
||
| 189 | 'flounder', |
||
| 190 | 'fun', |
||
| 191 | 'gallows', |
||
| 192 | 'garbage', |
||
| 193 | 'graffiti', |
||
| 194 | 'hardware', |
||
| 195 | 'headquarters', |
||
| 196 | 'health', |
||
| 197 | 'herpes', |
||
| 198 | 'highjinks', |
||
| 199 | 'homework', |
||
| 200 | 'housework', |
||
| 201 | 'information', |
||
| 202 | 'jeans', |
||
| 203 | 'justice', |
||
| 204 | 'kudos', |
||
| 205 | 'labour', |
||
| 206 | 'literature', |
||
| 207 | 'machinery', |
||
| 208 | 'mackerel', |
||
| 209 | 'mail', |
||
| 210 | 'media', |
||
| 211 | 'mews', |
||
| 212 | 'money', |
||
| 213 | 'moose', |
||
| 214 | 'music', |
||
| 215 | 'mud', |
||
| 216 | 'manga', |
||
| 217 | 'news', |
||
| 218 | 'only', |
||
| 219 | 'personnel', |
||
| 220 | 'pike', |
||
| 221 | 'plankton', |
||
| 222 | 'pliers', |
||
| 223 | 'police', |
||
| 224 | 'pollution', |
||
| 225 | 'premises', |
||
| 226 | 'rain', |
||
| 227 | 'research', |
||
| 228 | 'rice', |
||
| 229 | 'salmon', |
||
| 230 | 'scissors', |
||
| 231 | 'series', |
||
| 232 | 'sewage', |
||
| 233 | 'shambles', |
||
| 234 | 'shrimp', |
||
| 235 | 'software', |
||
| 236 | 'species', |
||
| 237 | 'staff', |
||
| 238 | 'swine', |
||
| 239 | 'tennis', |
||
| 240 | 'thanks', |
||
| 241 | 'traffic', |
||
| 242 | 'transportation', |
||
| 243 | 'trout', |
||
| 244 | 'tuna', |
||
| 245 | 'wealth', |
||
| 246 | 'welfare', |
||
| 247 | 'whiting', |
||
| 248 | 'wildebeest', |
||
| 249 | 'wildlife', |
||
| 250 | 'you', |
||
| 251 | '/pok[eé]mon$/i', |
||
| 252 | '/[^aeiou]ese$/i', |
||
| 253 | '/deer$/i', |
||
| 254 | '/fish$/i', |
||
| 255 | '/measles$/i', |
||
| 256 | '/o[iu]s$/i', |
||
| 257 | '/pox$/i', |
||
| 258 | '/sheep$/i' |
||
| 259 | ]; |
||
| 261 | } |