propelorm/Propel2

View on GitHub
src/Propel/Runtime/Connection/ConnectionWrapper.php

Summary

Maintainability
C
1 day
Test Coverage

ConnectionWrapper has 37 functions (exceeds 20 allowed). Consider refactoring.
Open

class ConnectionWrapper implements ConnectionInterface, LoggerAwareInterface
{
    use TransactionTrait;

    /**
Severity: Minor
Found in src/Propel/Runtime/Connection/ConnectionWrapper.php - About 4 hrs to fix

    File ConnectionWrapper.php has 302 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/Connection/ConnectionWrapper.php - About 3 hrs to fix

      Function setAttribute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setAttribute($attribute, $value)
          {
              if (is_string($attribute)) {
                  if (false === strpos($attribute, '::')) {
                      if (defined('\PDO::' . $attribute)) {
      Severity: Minor
      Found in src/Propel/Runtime/Connection/ConnectionWrapper.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

      Function commit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function commit()
          {
              $return = true;
              $opcount = $this->nestedTransactionCount;
      
      
      Severity: Minor
      Found in src/Propel/Runtime/Connection/ConnectionWrapper.php - About 55 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 rollBack has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function rollBack()
          {
              $return = true;
              $opcount = $this->nestedTransactionCount;
      
      
      Severity: Minor
      Found in src/Propel/Runtime/Connection/ConnectionWrapper.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 prepare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function prepare($statement, $driver_options = null)
          {
              $statementWrapper = null;
      
              if ($this->isCachePreparedStatements && isset($this->cachedPreparedStatements[$statement])) {
      Severity: Minor
      Found in src/Propel/Runtime/Connection/ConnectionWrapper.php - About 25 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