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
{

    /**
     * Build database connection
Severity: Minor
Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 3 hrs to fix

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

        public function createSelectSqlPart(Criteria $criteria, &$fromClause, $aliasAll = false)
        {
            $selectClause = [];
    
            if ($aliasAll) {
    Severity: Minor
    Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 3 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

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

    <?php
    
    /**
     * 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 3 hrs to fix

      Function getConnection has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getConnection($conparams)
          {
              $conparams = $this->prepareParams($conparams);
      
              if (!isset($conparams['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 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function createSelectSqlPart(Criteria $criteria, &$fromClause, $aliasAll = false)
          {
              $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($conparams)
            {
                $conparams = $this->prepareParams($conparams);
        
                if (!isset($conparams['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(\PDOStatement $stmt, $parameter, $value, ColumnMap $cMap, $position = null)
          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(\PDOStatement $stmt, array $params, DatabaseMap $dbMap)
                {
                    $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)
                {
                    $selected = [];
                    foreach ($criteria->getSelectColumns() as $columnName) {
                        if (false === strpos($columnName, '(')) {
            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