Conditions | 1 |
Paths | 1 |
Total Lines | 112 |
Code Lines | 96 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
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 |
||
195 | public function ecosystemAction() |
||
196 | { |
||
197 | $projects = []; |
||
198 | $project = new Project(); |
||
199 | $project->setTitle('Symfony Framework'); |
||
200 | $project->setDescription('Prevod ogrodja Symfony'); |
||
201 | $project->setLink('https://github.com/symfony/symfony'); |
||
202 | $project->setRepository('https://github.com/symfony/symfony'); |
||
203 | $project->setSlug('symfony'); |
||
204 | $projects[] = $project; |
||
205 | |||
206 | $project = new Project(); |
||
207 | $project->setTitle('Symfony.com'); |
||
208 | $project->setDescription('Symfony.com website'); |
||
209 | $project->setLink('https://github.com/symfony/symfony-marketing'); |
||
210 | $project->setRepository('https://github.com/symfony/symfony-marketing'); |
||
211 | $project->setSlug('symfony-marketing'); |
||
212 | $projects[] = $project; |
||
213 | |||
214 | $project = new Project(); |
||
215 | $project->setTitle('Sonata Project'); |
||
216 | $project->setDescription('Prevod projekta Sonata Project'); |
||
217 | $project->setLink('https://github.com/sonata-project'); |
||
218 | $project->setRepository('https://github.com/sonata-project'); |
||
219 | $project->setSlug('sonata-project'); |
||
220 | $projects[] = $project; |
||
221 | |||
222 | $project = new Project(); |
||
223 | $project->setTitle('EasyAdminBundle'); |
||
224 | $project->setDescription('Prevod Symfony paketa EasyAdminBundle'); |
||
225 | $project->setLink('https://github.com/javiereguiluz/EasyAdminBundle'); |
||
226 | $project->setRepository('https://github.com/javiereguiluz/EasyAdminBundle'); |
||
227 | $project->setSlug('easy-admin-bundle'); |
||
228 | $projects[] = $project; |
||
229 | |||
230 | $project = new Project(); |
||
231 | $project->setTitle('PHP: The Right Way'); |
||
232 | $project->setDescription('An easy-to-read, quick reference for PHP best practices, accepted coding standards, and links to authoritative tutorials around the Web'); |
||
233 | $project->setLink('http://sl.phptherightway.com'); |
||
234 | $project->setRepository('https://github.com/symfony-si/php-the-right-way'); |
||
235 | $project->setSlug('php-the-right-way'); |
||
236 | $projects[] = $project; |
||
237 | |||
238 | $project = new Project(); |
||
239 | $project->setTitle('PHP FIG'); |
||
240 | $project->setDescription('PHP Standards Recommendations'); |
||
241 | $project->setLink('http://php-fig.org'); |
||
242 | $project->setRepository('https://github.com/php-fig/fig-standards'); |
||
243 | $project->setSlug('php-fig-standards'); |
||
244 | $projects[] = $project; |
||
245 | |||
246 | $project = new Project(); |
||
247 | $project->setTitle('Magento'); |
||
248 | $project->setDescription('Magento 1.x Translation'); |
||
249 | $project->setLink('http://magento.com/'); |
||
250 | $project->setRepository('https://github.com/symfony-si/magento1-sl-si'); |
||
251 | $project->setSlug('magento1'); |
||
252 | $projects[] = $project; |
||
253 | |||
254 | $project = new Project(); |
||
255 | $project->setTitle('Magento 2'); |
||
256 | $project->setDescription('Magento 2.x Translation'); |
||
257 | $project->setLink('http://magento.com/'); |
||
258 | $project->setRepository('https://github.com/symfony-si/magento2-sl_si'); |
||
259 | $project->setSlug('magento2'); |
||
260 | $projects[] = $project; |
||
261 | |||
262 | $project = new Project(); |
||
263 | $project->setTitle('Semver.org'); |
||
264 | $project->setDescription('Semantic Versions'); |
||
265 | $project->setLink('http://semver.org/lang/sl'); |
||
266 | $project->setRepository('https://github.com/mojombo/semver.org'); |
||
267 | $project->setSlug('semantic-versioning'); |
||
268 | $projects[] = $project; |
||
269 | |||
270 | $project = new Project(); |
||
271 | $project->setTitle('The PHP League'); |
||
272 | $project->setDescription('Slovenski prevod strani PHP lige paketov'); |
||
273 | $project->setLink('http://thephpleague.com/sl/'); |
||
274 | $project->setRepository('https://github.com/thephpleague/thephpleague.github.io'); |
||
275 | $project->setSlug('the-php-league'); |
||
276 | $projects[] = $project; |
||
277 | |||
278 | $project = new Project(); |
||
279 | $project->setTitle('Yii framework'); |
||
280 | $project->setDescription('Slovenski prevod ogrodja Yii 2'); |
||
281 | $project->setLink('https://github.com/yiisoft/yii2'); |
||
282 | $project->setRepository('https://github.com/yiisoft/yii2'); |
||
283 | $project->setSlug('the-php-league'); |
||
284 | $projects[] = $project; |
||
285 | |||
286 | $project = new Project(); |
||
287 | $project->setTitle('Progit'); |
||
288 | $project->setDescription('Slovenski prevod knjige progit'); |
||
289 | $project->setLink('http://git-scm.com/book/sl'); |
||
290 | $project->setRepository('https://github.com/progit/progit2-sl'); |
||
291 | $project->setSlug('progit'); |
||
292 | $projects[] = $project; |
||
293 | |||
294 | $project = new Project(); |
||
295 | $project->setTitle('Zend Framework 2'); |
||
296 | $project->setDescription('Slovenian translation of Zend Framework 2'); |
||
297 | $project->setLink('https://github.com/zendframework/zf2'); |
||
298 | $project->setRepository('https://github.com/zendframework/zf2'); |
||
299 | $project->setSlug('zend-framework-2'); |
||
300 | $projects[] = $project; |
||
301 | |||
302 | return $this->render( |
||
303 | 'default/ecosystem.html.twig', |
||
304 | ['projects' => $projects] |
||
305 | ); |
||
306 | } |
||
307 | |||
324 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.