chrisandchris/passive-record-orm

View on GitHub

Showing 149 of 161 total issues

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    function __construct($system, $host, $port = null, $name = null, $user = null, $password = null)
Severity: Minor
Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Pdo/PdoLayer.php - About 45 mins to fix

    Function run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function run(
            \Closure $process,
            $eventClass = null,
            $eventData = null
        ) {
    Severity: Minor
    Found in src/ChrisAndChris/Common/RowMapperBundle/Services/BusinessProcess.php - About 45 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

    Method getDsn has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getDsn($system, $host, $port, $database, $username, $password)
    Severity: Minor
    Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Pdo/PdoLayer.php - About 45 mins to fix

      Method bindColumn has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
      Severity: Minor
      Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Pdo/PdoStatement.php - About 35 mins to fix

        Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $query,
                $parameters = [],
                $calcRowCapable = false,
                array $mappingInfo = null,
                bool $readOnly = false
        Severity: Minor
        Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Query/SqlQuery.php - About 35 mins to fix

          Method bindParam has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $parameter,
                  &$variable,
                  $data_type = PDO::PARAM_STR,
                  $length = null,
                  $driver_options = null
          Severity: Minor
          Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Pdo/PdoStatement.php - About 35 mins to fix

            Method getPgDsn has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private function getPgDsn($host, $port, $database, $username, $password)
            Severity: Minor
            Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Pdo/PdoLayer.php - About 35 mins to fix

              Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function __construct($source = null, $target = null, $sourceField = null, $targetField = null, $alias = null)
              Severity: Minor
              Found in src/ChrisAndChris/Common/RowMapperBundle/Entity/Mapping/Relation.php - About 35 mins to fix

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

                    public function combine($builder)
                    {
                        if (!$this->allowAppend() || $builder === null) {
                            return $this;
                        }
                Severity: Minor
                Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Query/Builder.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

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

                    public function mapToArray($statement, Entity $entity, \Closure $callable)
                    {
                        $array = $this->mapFromResult($statement, $entity);
                        $return = [];
                        foreach ($array as $row) {
                Severity: Minor
                Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Mapper/RowMapper.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

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

                    private function logOut(
                        $start,
                        $eventClass = null,
                        $result = null,
                        $eventData = null
                Severity: Minor
                Found in src/ChrisAndChris/Common/RowMapperBundle/Services/BusinessProcess.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

                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 [
                                    'code'   => 'UPDATE ' . $params['table'] . ' SET',
                                    'params' => null,
                                ];

                  Avoid too many return statements within this method.
                  Open

                                  return [
                                      'code'   => 'WHERE /@brace(where)',
                                      'params' => null,
                                  ];

                    Avoid too many return statements within this method.
                    Open

                                    return [
                                        'code'   => ',',
                                        'params' => null,
                                    ];

                      Avoid too many return statements within this method.
                      Open

                                      return [
                                          'code'       => 'DELETE `' . $params['table'] . '` FROM `' .
                                              $params['table'] . '`',
                                          'params'     => null,
                                      ];

                        Avoid too many return statements within this method.
                        Open

                                            return 'UNION ALL';

                          Avoid too many return statements within this method.
                          Open

                                          return [
                                              'code'   => '( /@brace(brace) )',
                                              'params' => null,
                                          ];

                            Avoid too many return statements within this method.
                            Open

                                            return [
                                                'code'   => 'ILIKE ?',
                                                'params' => $params['pattern'],
                                            ];

                              Avoid too many return statements within this method.
                              Open

                                              return [
                                                  'code'   => $this->implodeIdentifier($params['field'],
                                                          self::DELIMITER)
                                                      . ' ' . strtoupper($params['direction']),
                                                  'params' => null,
                                Severity
                                Category
                                Status
                                Source
                                Language