mathieupetrini/doctrinedatatable

View on GitHub
src/DoctrineDatatable/DatatableWithTotal.php

Summary

Maintainability
A
35 mins
Test Coverage

Function calculTotaux has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function calculTotaux(): array
    {
        $query = clone $this->final_query;

        $query->resetDQLPart('orderBy');
Severity: Minor
Found in src/DoctrineDatatable/DatatableWithTotal.php - About 35 mins to fix

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

        $query->resetDQLPart('orderBy');

non numerical values compared by the operators '==' or '!='
Open

            0 == $index ?

Call to method select from undeclared class \Doctrine\ORM\QueryBuilder
Open

                $query->select("$column as $alias") :

Call to method getQuery from undeclared class \Doctrine\ORM\QueryBuilder
Open

        foreach ($query->getQuery()->getResult() as $result) {

Call to method setFirstResult from undeclared class \Doctrine\ORM\QueryBuilder
Open

        $temp = (clone $this->final_query)

Call to method getEntityManager from undeclared class \Doctrine\ORM\QueryBuilder
Open

        return (int) ((clone $this->final_query)->getEntityManager()

Call to method addSelect from undeclared class \Doctrine\ORM\QueryBuilder
Open

                $query->addSelect("$column as $alias");

There are no issues that match your filters.

Category
Status