cassell/Parm

View on GitHub
src/DataAccessObjectFactory.php

Summary

Maintainability
D
2 days
Test Coverage

DataAccessObjectFactory has 57 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class DataAccessObjectFactory extends DatabaseProcessor implements TableInterface
{
    private $fields = array();
    private $conditional;
    private $joinClause = '';
Severity: Major
Found in src/DataAccessObjectFactory.php - About 1 day to fix

    File DataAccessObjectFactory.php has 414 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Parm;
    
    use Parm\Binding\Binding;
    Severity: Minor
    Found in src/DataAccessObjectFactory.php - About 5 hrs to fix

      Function setSelectFields has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setSelectFields($arrayOfFields)
          {
              if ($arrayOfFields == null) {
                  throw new Exception\ErrorException('setSelectFields($arrayOfFields) $arrayOfFields can\'t be null.');
              } elseif (func_num_args() == 1 && is_array($arrayOfFields)) {
      Severity: Minor
      Found in src/DataAccessObjectFactory.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 groupBy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function groupBy($fieldOrArray)
          {
              if (func_num_args() > 1) {
                  // passed multiple fields $f->addGroupBy("first_name","last_name")
                  $this->groupBy(func_get_args());
      Severity: Minor
      Found in src/DataAccessObjectFactory.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 getObjects has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getObjects()
          {
              $data = array();
      
              if (static::getIdField() != null) {
      Severity: Minor
      Found in src/DataAccessObjectFactory.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