src/DoctrineDatatable/DatatableWithTotal.php
Function calculTotaux
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
private function calculTotaux(): array
{
$query = clone $this->final_query;
$query->resetDQLPart('orderBy');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Call to method resetDQLPart
from undeclared class \Doctrine\ORM\QueryBuilder
Open
Open
$query->resetDQLPart('orderBy');
- Exclude checks
non numerical values compared by the operators '==' or '!=' Open
Open
0 == $index ?
- Exclude checks
Call to method select
from undeclared class \Doctrine\ORM\QueryBuilder
Open
Open
$query->select("$column as $alias") :
- Exclude checks
Call to method getQuery
from undeclared class \Doctrine\ORM\QueryBuilder
Open
Open
foreach ($query->getQuery()->getResult() as $result) {
- Exclude checks
Call to method setFirstResult
from undeclared class \Doctrine\ORM\QueryBuilder
Open
Open
$temp = (clone $this->final_query)
- Exclude checks
Call to method getEntityManager
from undeclared class \Doctrine\ORM\QueryBuilder
Open
Open
return (int) ((clone $this->final_query)->getEntityManager()
- Exclude checks
Call to method addSelect
from undeclared class \Doctrine\ORM\QueryBuilder
Open
Open
$query->addSelect("$column as $alias");
- Exclude checks