mathieupetrini/doctrinedatatable

View on GitHub
src/DoctrineDatatable/Editortable.php

Summary

Maintainability
A
35 mins
Test Coverage

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

    private function processRowEditing(object $entity, array $data): array
    {
        $entities = array();
        foreach ($data as $field => $value) {
            $property = $this->processValue($entity, $field, $value);
Severity: Minor
Found in src/DoctrineDatatable/Editortable.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

@throws type of edit has undeclared type \Doctrine\ORM\ORMException
Open

    public function edit(array $params): array
Severity: Minor
Found in src/DoctrineDatatable/Editortable.php by phan

@throws type of edit has undeclared type \Doctrine\ORM\OptimisticLockException
Open

    public function edit(array $params): array
Severity: Minor
Found in src/DoctrineDatatable/Editortable.php by phan

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

                $value = $this->query->getEntityManager()->getRepository(
Severity: Critical
Found in src/DoctrineDatatable/Editortable.php by phan

Parameter $query has undeclared type \Doctrine\ORM\QueryBuilder
Open

    public function __construct(QueryBuilder $query, string $identifier, array $columns, array $parameters = array())
Severity: Minor
Found in src/DoctrineDatatable/Editortable.php by phan

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

            ->where($this->query->getRootAliases()[0].' IN (:entities)')
Severity: Critical
Found in src/DoctrineDatatable/Editortable.php by phan

@throws type of getResultsAfterEdit has undeclared type \Doctrine\ORM\ORMException
Open

    private function getResultsAfterEdit(array $entities): array
Severity: Minor
Found in src/DoctrineDatatable/Editortable.php by phan

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

        $repository = $this->query->getEntityManager()->getRepository($this->rootClass);
Severity: Critical
Found in src/DoctrineDatatable/Editortable.php by phan

@throws type of getResultsAfterEdit has undeclared type \Doctrine\ORM\OptimisticLockException
Open

    private function getResultsAfterEdit(array $entities): array
Severity: Minor
Found in src/DoctrineDatatable/Editortable.php by phan

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

        $this->query->getEntityManager()->flush($entities);
Severity: Critical
Found in src/DoctrineDatatable/Editortable.php by phan

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

        return $this->createQueryResult()
Severity: Critical
Found in src/DoctrineDatatable/Editortable.php by phan

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

            $associations = $this->query->getEntityManager()->getClassMetadata($this->rootClass)->associationMappings;
Severity: Critical
Found in src/DoctrineDatatable/Editortable.php by phan

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

        $this->query->getEntityManager()->getUnitOfWork()->computeChangeSets();
Severity: Critical
Found in src/DoctrineDatatable/Editortable.php by phan

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

        $this->rootClass = $query->getRootEntities()[0];
Severity: Critical
Found in src/DoctrineDatatable/Editortable.php by phan

There are no issues that match your filters.

Category
Status