| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function createSelectAndGroupBy($entityName, $alias, $groupByField) |
||
| 27 | { |
||
| 28 | $select = $alias . '.' . $groupByField . ', count(' . $alias . '.id) as num'; |
||
| 29 | $groupBy = $alias . '.' . $groupByField . ''; |
||
| 30 | |||
| 31 | $this->entityName = $entityName; |
||
| 32 | $this->entityAlias = $alias; |
||
| 33 | |||
| 34 | $this->qBuilder = $this->manager->createQueryBuilder($this->entityName) |
||
|
|
|||
| 35 | ->select($select) |
||
| 36 | ->groupBy($groupBy); |
||
| 37 | } |
||
| 54 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.