spotweb/spotweb

View on GitHub
lib/dbstruct/SpotStruct_abs.php

Summary

Maintainability
F
5 days
Test Coverage

Method updateSchema has 384 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function updateSchema()
    {
        // Drop any older (not used anymore) FTS indexes on the spots full table
        $this->dropIndex('idx_spotsfull_fts_1', 'spotsfull');
        $this->dropIndex('idx_spotsfull_fts_2', 'spotsfull');
Severity: Major
Found in lib/dbstruct/SpotStruct_abs.php - About 1 day to fix

    File SpotStruct_abs.php has 540 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    abstract class SpotStruct_abs
    {
        protected $_dbcon;
    Severity: Major
    Found in lib/dbstruct/SpotStruct_abs.php - About 1 day to fix

      Function updateSchema has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
      Open

          public function updateSchema()
          {
              // Drop any older (not used anymore) FTS indexes on the spots full table
              $this->dropIndex('idx_spotsfull_fts_1', 'spotsfull');
              $this->dropIndex('idx_spotsfull_fts_2', 'spotsfull');
      Severity: Minor
      Found in lib/dbstruct/SpotStruct_abs.php - About 7 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

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

      abstract class SpotStruct_abs
      {
          protected $_dbcon;
      
          public function __construct(dbeng_abs $dbEng)
      Severity: Minor
      Found in lib/dbstruct/SpotStruct_abs.php - About 4 hrs to fix

        Function compareIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            public function compareIndex($idxname, $type, $tablename, $colList)
            {
                // Retrieve index information
                $q = $this->getIndexInfo($idxname, $tablename);
        
        
        Severity: Minor
        Found in lib/dbstruct/SpotStruct_abs.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 modifyColumn has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            abstract public function modifyColumn($colName, $tablename, $colType, $colDefault, $notNull, $collation, $what);
        Severity: Major
        Found in lib/dbstruct/SpotStruct_abs.php - About 50 mins to fix

          Function compareColumn has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function compareColumn($colName, $tablename, $colType, $colDefault, $notNull, $collation)
              {
                  // Retrieve the column information
                  $q = $this->getColumnInfo($tablename, $colName);
          
          
          Severity: Minor
          Found in lib/dbstruct/SpotStruct_abs.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

          Method compareColumn has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function compareColumn($colName, $tablename, $colType, $colDefault, $notNull, $collation)
          Severity: Minor
          Found in lib/dbstruct/SpotStruct_abs.php - About 45 mins to fix

            Method addColumn has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                abstract public function addColumn($colName, $tablename, $colType, $colDefault, $notNull, $collation);
            Severity: Minor
            Found in lib/dbstruct/SpotStruct_abs.php - About 45 mins to fix

              Method validateColumn has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function validateColumn($colName, $tablename, $colType, $colDefault, $notNull, $collation)
              Severity: Minor
              Found in lib/dbstruct/SpotStruct_abs.php - About 45 mins to fix

                Method dropForeignKey has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    abstract public function dropForeignKey($tablename, $colname, $reftable, $refcolumn, $action);
                Severity: Minor
                Found in lib/dbstruct/SpotStruct_abs.php - About 35 mins to fix

                  Method addForeignKey has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      abstract public function addForeignKey($tablename, $colname, $reftable, $refcolumn, $action);
                  Severity: Minor
                  Found in lib/dbstruct/SpotStruct_abs.php - About 35 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return 'charset';
                    Severity: Major
                    Found in lib/dbstruct/SpotStruct_abs.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return true;
                      Severity: Major
                      Found in lib/dbstruct/SpotStruct_abs.php - About 30 mins to fix

                        There are no issues that match your filters.

                        Category
                        Status