chrisandchris/passive-record-orm

View on GitHub
src/ChrisAndChris/Common/RowMapperBundle/Services/Model/ConcreteModel.php

Summary

Maintainability
C
1 day
Test Coverage

File ConcreteModel.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace ChrisAndChris\Common\RowMapperBundle\Services\Model;

use ChrisAndChris\Common\RowMapperBundle\Entity\Entity;

    ConcreteModel has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ConcreteModel
    {
    
        /** @var ModelDependencyProvider the dependency provider */
        protected $dependencyProvider;

      Function runCustom has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          public function runCustom(
              SqlQuery $query,
              $onSuccess,
              $onFailure,
              $onError = null

      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

      Method handle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function handle(
              PdoStatement $statement,
              Entity $entity = null,
              \Closure $callAfter = null,
              array $mappingInfo = []

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

            private function handleGeneric(
                PdoStatement $statement,
                \Closure $mappingCallback
            ) {
                if ($this->execute($statement)) {

        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

        Avoid too many return statements within this method.
        Open

                            return $onError();

          Avoid too many return statements within this method.
          Open

                      return $onError;

            Function prepareOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function prepareOptions(array $availableOptions, array &$options)
                {
                    foreach ($availableOptions as $option) {
                        if (!isset($options[$option])) {
                            $options[$option] = null;

            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

            Function prepare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function prepare(SqlQuery $query)
                {
                    $stmt = $this->createStatement(
                        $query->getQuery(),
                        $query->isReadOnly()

            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

            There are no issues that match your filters.

            Category
            Status