CORE-POS/Common-Bundle

View on GitHub

Showing 1,039 of 1,039 total issues

File BasicModel.php has 1065 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*******************************************************************************

    Copyright 2013 Whole Foods Co-op

Severity: Major
Found in src/BasicModel.php - About 2 days to fix

    File SQLManager.php has 1032 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*******************************************************************************
    
        Copyright 2009 Whole Foods Co-op
    
    
    Severity: Major
    Found in src/SQLManager.php - About 2 days to fix

      SQLManager has 91 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class SQLManager 
      {
          private $QUERY_LOG; 
      
          /** Array of connections **/
      Severity: Major
      Found in src/SQLManager.php - About 1 day to fix

        Function normalize has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
        Open

            public function normalize($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK)
            {
                if ($mode != BasicModel::NORMALIZE_MODE_CHECK && $mode != BasicModel::NORMALIZE_MODE_APPLY) {
                    echo "Error: Unknown mode ($mode)\n";
                    return false;
        Severity: Minor
        Found in src/BasicModel.php - About 1 day 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

        BasicModel has 51 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class BasicModel 
        {
            /**
              Name of the table
            */
        Severity: Major
        Found in src/BasicModel.php - About 7 hrs to fix

          CorePage has 35 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class CorePage 
          {
              public $description = "
              Base class for creating HTML pages.
              ";
          Severity: Minor
          Found in src/ui/CorePage.php - About 4 hrs to fix

            Method normalize has 110 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function normalize($db_name, $mode=BasicModel::NORMALIZE_MODE_CHECK)
                {
                    if ($mode != BasicModel::NORMALIZE_MODE_CHECK && $mode != BasicModel::NORMALIZE_MODE_APPLY) {
                        echo "Error: Unknown mode ($mode)\n";
                        return false;
            Severity: Major
            Found in src/BasicModel.php - About 4 hrs to fix

              Function find has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function find($sort='', $reverse=false)
                  {
                      if (!is_array($sort)) {
                          $sort = array($sort);
                      }
              Severity: Minor
              Found in src/BasicModel.php - About 4 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 cli has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function cli($argc, $argv)
                  {
                      if ($argc > 2 && $argv[1] == '--doc') {
                          array_shift($argv);
                          array_shift($argv);
              Severity: Minor
              Found in src/BasicModel.php - About 4 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

              The class CorePage has 26 non-getter- and setter-methods. Consider refactoring CorePage to keep number of methods under 25.
              Open

              class CorePage 
              {
                  public $description = "
                  Base class for creating HTML pages.
                  ";
              Severity: Minor
              Found in src/ui/CorePage.php by phpmd

              TooManyMethods

              Since: 0.1

              A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

              By default it ignores methods starting with 'get' or 'set'.

              The default was changed from 10 to 25 in PHPMD 2.3.

              Example

              Source https://phpmd.org/rules/codesize.html#toomanymethods

              The class CorePage has an overall complexity of 50 which is very high. The configured complexity threshold is 50.
              Open

              class CorePage 
              {
                  public $description = "
                  Base class for creating HTML pages.
                  ";
              Severity: Minor
              Found in src/ui/CorePage.php by phpmd

              The class SQLManager has 74 non-getter- and setter-methods. Consider refactoring SQLManager to keep number of methods under 25.
              Open

              class SQLManager 
              {
                  private $QUERY_LOG; 
              
                  /** Array of connections **/
              Severity: Minor
              Found in src/SQLManager.php by phpmd

              TooManyMethods

              Since: 0.1

              A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

              By default it ignores methods starting with 'get' or 'set'.

              The default was changed from 10 to 25 in PHPMD 2.3.

              Example

              Source https://phpmd.org/rules/codesize.html#toomanymethods

              The class SQLManager has 66 public methods. Consider refactoring SQLManager to keep number of public methods under 10.
              Open

              class SQLManager 
              {
                  private $QUERY_LOG; 
              
                  /** Array of connections **/
              Severity: Minor
              Found in src/SQLManager.php by phpmd

              TooManyPublicMethods

              Since: 0.1

              A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

              By default it ignores methods starting with 'get' or 'set'.

              Example

              Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

              The class SQLManager has an overall complexity of 287 which is very high. The configured complexity threshold is 50.
              Open

              class SQLManager 
              {
                  private $QUERY_LOG; 
              
                  /** Array of connections **/
              Severity: Minor
              Found in src/SQLManager.php by phpmd

              The class BasicModel has 20 public methods. Consider refactoring BasicModel to keep number of public methods under 10.
              Open

              class BasicModel 
              {
                  /**
                    Name of the table
                  */
              Severity: Minor
              Found in src/BasicModel.php by phpmd

              TooManyPublicMethods

              Since: 0.1

              A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

              By default it ignores methods starting with 'get' or 'set'.

              Example

              Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

              The class BasicModel has an overall complexity of 317 which is very high. The configured complexity threshold is 50.
              Open

              class BasicModel 
              {
                  /**
                    Name of the table
                  */
              Severity: Minor
              Found in src/BasicModel.php by phpmd

              The class BasicModel has 35 non-getter- and setter-methods. Consider refactoring BasicModel to keep number of methods under 25.
              Open

              class BasicModel 
              {
                  /**
                    Name of the table
                  */
              Severity: Minor
              Found in src/BasicModel.php by phpmd

              TooManyMethods

              Since: 0.1

              A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

              By default it ignores methods starting with 'get' or 'set'.

              The default was changed from 10 to 25 in PHPMD 2.3.

              Example

              Source https://phpmd.org/rules/codesize.html#toomanymethods

              The class PgsqlAdapter has 19 public methods. Consider refactoring PgsqlAdapter to keep number of public methods under 10.
              Open

              class PgsqlAdapter implements DialectAdapter
              {
                  public function createNamedDB($name)
                  {
                      return 'CREATE SCHEMA ' . $this->identifierEscape($name);
              Severity: Minor
              Found in src/sql/PgsqlAdapter.php by phpmd

              TooManyPublicMethods

              Since: 0.1

              A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

              By default it ignores methods starting with 'get' or 'set'.

              Example

              Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

              The class MssqlAdapter has 19 public methods. Consider refactoring MssqlAdapter to keep number of public methods under 10.
              Open

              class MssqlAdapter implements DialectAdapter
              {
                  public function createNamedDB($name)
                  {
                      return 'CREATE DATABASE ' . $this->identifierEscape($name);
              Severity: Minor
              Found in src/sql/MssqlAdapter.php by phpmd

              TooManyPublicMethods

              Since: 0.1

              A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

              By default it ignores methods starting with 'get' or 'set'.

              Example

              Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

              The class MysqlAdapter has 19 public methods. Consider refactoring MysqlAdapter to keep number of public methods under 10.
              Open

              class MysqlAdapter implements DialectAdapter
              {
                  public function createNamedDB($name)
                  {
                      return 'CREATE DATABASE ' . $this->identifierEscape($name);
              Severity: Minor
              Found in src/sql/MysqlAdapter.php by phpmd

              TooManyPublicMethods

              Since: 0.1

              A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

              By default it ignores methods starting with 'get' or 'set'.

              Example

              Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

              Severity
              Category
              Status
              Source
              Language