qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

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

        public function __set($strName, $mixValue) {
            $this->blnModified = true;

            switch ($strName) {
                // MISC
Severity: Minor
Found in includes/base_controls/QDateTimePicker.class.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

File QQMathOpTest.php has 336 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 *
 * @package Tests
 */
Severity: Minor
Found in includes/tests/qcubed-unit/QQMathOpTest.php - About 4 hrs to fix

    Method AnalyzeAssociationTable has 101 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            protected function AnalyzeAssociationTable($strTableName) {
                $objFieldArray = $this->objDb->GetFieldsForTable($strTableName);
    
                // Association tables must have 2 fields
                if (count($objFieldArray) != 2) {
    Severity: Major
    Found in includes/codegen/QDatabaseCodeGen.class.php - About 4 hrs to fix

      Method qFormat has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function qFormat($strFormat = null) {
                  if ($this->blnDateNull && $this->blnTimeNull) {
                      return '';
                  }
      
      
      Severity: Major
      Found in includes/framework/QDateTime.class.php - About 4 hrs to fix

        Method __set has 99 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function __set($strName, $mixValue) {
                    $this->blnModified = true;
                    switch ($strName) {
                        case "MinDate" :
                            try {
        Severity: Major
        Found in includes/base_controls/QCalendar.class.php - About 3 hrs to fix

          Method __construct has 98 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct($mixFieldData, $objDb = null) {
                  $objDatabaseRow = null;
                  
                  $objDatabaseRow = $mixFieldData ; // BG New 
                          
          Severity: Major
          Found in includes/database/QInformixPdoDatabase.class.php - About 3 hrs to fix

            Function __construct has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                    public function __construct(QQColumnNode $objQueryNode, $mixOperand = null) {
                        $this->objQueryNode = $objQueryNode;
            
                        if ($mixOperand instanceof QQNamedValue || $mixOperand === null)
                            $this->mixOperand = $mixOperand;
            Severity: Minor
            Found in includes/framework/QQuery.class.php - About 3 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

            Method TriggerActions has 97 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    protected function TriggerActions($strControlIdOverride = null) {
                        if (array_key_exists('Qform__FormControl', $_POST)) {
                            if ($strControlIdOverride) {
                                $strControlId = $strControlIdOverride;
                            } else {
            Severity: Major
            Found in includes/base_controls/QFormBase.class.php - About 3 hrs to fix

              File QDialogGen.class.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php    
                  /**
                   * Triggered when a dialog is about to close. If canceled, the dialog
                   * will not close.
                   * 
              Severity: Minor
              Found in includes/base_controls/QDialogGen.class.php - About 3 hrs to fix

                Method __set has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public function __set($strName, $mixValue) {
                            switch ($strName) {
                                case "ItemCssStyle":
                                    try {
                                        $this->strItemCssStyle = QType::Cast($mixValue, QType::String);
                Severity: Major
                Found in includes/base_controls/QTreeNav.class.php - About 3 hrs to fix

                  Function __set has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                  Open

                          public function __set($strName, $mixValue) {
                              switch ($strName) {
                                  case "ItemCssStyle":
                                      try {
                                          $this->strItemCssStyle = QType::Cast($mixValue, QType::String);
                  Severity: Minor
                  Found in includes/base_controls/QTreeNav.class.php - About 3 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 SetFieldType has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                  Open

                          protected function SetFieldType($intMySqlFieldType) {
                  
                              if (version_compare(PHP_VERSION, '5.6.15') >= 0) {
                                  if (defined("MYSQLI_TYPE_JSON") && $intMySqlFieldType == MYSQLI_TYPE_JSON) {
                                      $this->strType = QDatabaseFieldType::Json;
                  Severity: Minor
                  Found in includes/database/QMySqliDatabase.class.php - About 3 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 __construct has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function __construct($mixFieldData, $objDb = null, $strTableName=null) {
                          $this->strName = $mixFieldData->GetColumn('name');
                          // Set strOriginalName to Name if it isn't set
                          if (!$this->strOriginalName)
                              $this->strOriginalName = $this->strName;
                  Severity: Minor
                  Found in includes/database/QSqLite3PdoDatabase.class.php - About 3 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 CreateClassNameArray has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function CreateClassNameArray() {
                          // create the control array
                          $controls = array();
                          include (__QCUBED_CORE__ . '/control_registry.inc.php');
                  
                  
                  Severity: Minor
                  Found in includes/codegen/QModelConnectorEditDlg.class.php - About 3 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

                  Method __set has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public function __set($strName, $mixValue) {
                              switch ($strName) {
                                  // APPEARANCE
                                  case "Text":
                                      try {
                  Severity: Major
                  Found in includes/base_controls/QBlockControl.class.php - About 3 hrs to fix

                    Method __set has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public function __set($strName, $mixValue) {
                                $this->blnModified = true;
                    
                                switch ($strName) {
                                    case 'File':
                    Severity: Major
                    Found in includes/base_controls/QFileAssetBase.class.php - About 3 hrs to fix

                      Method __get has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public function __get($strName) {
                                  switch ($strName) {
                                      // APPEARANCE
                                      case "AlternateRowStyle": return $this->objAlternateRowStyle;
                                      case "HeaderRowStyle": return $this->objHeaderRowStyle;
                      Severity: Major
                      Found in includes/base_controls/QDataGridLegacyBase.class.php - About 3 hrs to fix

                        File QCheckBoxList.class.php has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                            /**
                             * This file contains the QCheckBoxList class.
                             *
                             * @package Controls
                        Severity: Minor
                        Found in includes/base_controls/QCheckBoxList.class.php - About 3 hrs to fix

                          File ExpandAsArrayTest.php has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * Tests for the ExpandAsArray functionality in QQuery
                           * 
                           * @package Tests
                          Severity: Minor
                          Found in includes/tests/qcubed-unit/ExpandAsArrayTest.php - About 3 hrs to fix

                            File QImageBase.class.php has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                                /**
                                 * This file contains the QImageBase class.
                                 *
                                 * @package Controls
                            Severity: Minor
                            Found in includes/base_controls/QImageBase.class.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language