Passed
Push — master ( bcba07...4f2fea )
by Julito
08:02
created

CAnnouncementRepository::getAnnouncements()   F

Complexity

Conditions 23
Paths 1280

Size

Total Lines 161
Code Lines 88

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 23
eloc 88
nc 1280
nop 11
dl 0
loc 161
rs 0
c 0
b 0
f 0

How to fix   Long Method    Complexity    Many Parameters   

Long Method

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:

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
/* For licensing terms, see /license.txt */
4
5
namespace Chamilo\CourseBundle\Repository;
6
7
use Chamilo\CoreBundle\Repository\ResourceRepository;
8
9
/**
10
 * Class CAnnouncementRepository.
11
 */
12
final class CAnnouncementRepository extends ResourceRepository
13
{
14
}
15