propelorm/Propel2

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

Summary

Maintainability
C
1 day
Test Coverage

ConnectionWrapper has 38 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 5 hrs to fix

    File ConnectionWrapper.php has 308 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/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): bool
          {
              if (is_string($attribute)) {
                  if (strpos($attribute, '::') === false) {
                      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 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function commit(): bool
          {
              $return = true;
              $opcount = $this->nestedTransactionCount;
      
      
      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 rollBack has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function rollBack(): bool
          {
              $return = true;
              $opcount = $this->nestedTransactionCount;
      
      
      Severity: Minor
      Found in src/Propel/Runtime/Connection/ConnectionWrapper.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

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

          public function prepare(string $statement, array $driverOptions = [])
          {
              if ($this->isCachePreparedStatements && isset($this->cachedPreparedStatements[$statement])) {
                  $statementWrapper = $this->cachedPreparedStatements[$statement];
              } else {
      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