propelorm/Propel2

View on GitHub
src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php

Summary

Maintainability
D
1 day
Test Coverage

PdoAdapter has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class PdoAdapter
{
    /**
     * Indicates if the database system can process DELETE statements with
     * aliases like 'DELETE t FROM my_table t JOIN my_other_table o ON ...'
Severity: Minor
Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 3 hrs to fix

    File PdoAdapter.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * MIT License. This file is part of the Propel package.
     * For the full copyright and license information, please view the LICENSE
    Severity: Minor
    Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 2 hrs to fix

      Function createSelectSqlPart has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createSelectSqlPart(Criteria $criteria, array &$fromClause, bool $aliasAll = false): string
          {
              $selectClause = [];
      
              if ($aliasAll) {
      Severity: Minor
      Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 2 hrs 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 getConnection has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getConnection(array $params): PdoConnection
          {
              $params = $this->prepareParams($params);
      
              if (!isset($params['dsn'])) {
      Severity: Minor
      Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 1 hr 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 createSelectSqlPart has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function createSelectSqlPart(Criteria $criteria, array &$fromClause, bool $aliasAll = false): string
          {
              $selectClause = [];
      
              if ($aliasAll) {
      Severity: Minor
      Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 1 hr to fix

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

            public function getConnection(array $params): PdoConnection
            {
                $params = $this->prepareParams($params);
        
                if (!isset($params['dsn'])) {
        Severity: Minor
        Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 1 hr to fix

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

              public function bindValue(StatementInterface $stmt, string $parameter, $value, ColumnMap $cMap, ?int $position = null): bool
          Severity: Minor
          Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 35 mins to fix

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

                public function bindValues(StatementInterface $stmt, array $params, DatabaseMap $dbMap): void
                {
                    $position = 0;
                    foreach ($params as $param) {
                        $position++;
            Severity: Minor
            Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.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 getPlainSelectedColumns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getPlainSelectedColumns(Criteria $criteria): array
                {
                    $selected = [];
                    foreach ($criteria->getSelectColumns() as $columnName) {
                        if (strpos($columnName, '(') === false) {
            Severity: Minor
            Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.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

            There are no issues that match your filters.

            Category
            Status