qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

Function AnalyzeDatabase has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
Open

        protected function AnalyzeDatabase() {
            if (!QApplication::$Database) {
                $this->strErrors = 'FATAL ERROR: No databases are listed in the configuration file.';
                return;
            }
Severity: Minor
Found in includes/codegen/QDatabaseCodeGen.class.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

QControlBase has 96 functions (exceeds 20 allowed). Consider refactoring.
Open

    abstract class QControlBase extends QHtmlAttributeManager {

        /*
         * Constannts
         */
Severity: Major
Found in includes/base_controls/QControlBase.class.php - About 1 day to fix

    Function RenderImage has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
    Open

            public function RenderImage($strPath = null) {
                if (!$this->strImagePath)
                    throw new QCallerException('No Image Path was set');
    
                // Flow Through if No Size Information
    Severity: Minor
    Found in includes/base_controls/QImageControlBase.class.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

    Function Initialize has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
    Open

            public static function Initialize() {
                self::$EncodingType = defined('__QAPPLICATION_ENCODING_TYPE__') ? __QAPPLICATION_ENCODING_TYPE__ : self::$EncodingType;
    
                // Are we running as CLI?
                if (PHP_SAPI == 'cli')
    Severity: Minor
    Found in includes/framework/QApplicationBase.class.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

    Function GetControlHtml has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

            protected function GetControlHtml() {
                // Ignore Class
                $strCssClass = $this->strCssClass;
                $this->strCssClass = '';
                $strAttributes = $this->GetAttributes();
    Severity: Minor
    Found in includes/base_controls/QDateTimePicker.class.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

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

            public function __set($strName, $mixValue) {
                switch ($strName) {
                    // Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
                    case "Position":
                    case "Top":
    Severity: Minor
    Found in includes/base_controls/QControlBase.class.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

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

        public function __set($strName, $mixValue) {
            switch ($strName) {
                // Styles
                case "BackColor":
                    try {
    Severity: Minor
    Found in includes/base_controls/QHtmlAttributeManagerBase.class.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

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

    <?php
        /**
         * This abstract class should never be instantiated.  It contains static methods,
         * variables and constants to be used throughout the application.
         *
    Severity: Major
    Found in includes/framework/QApplicationBase.class.php - About 1 day to fix

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

      <?php    
      
          /* Custom "property" event classes for this control */
          /**
           * Type:Function( Element input, Object inst )Default:nullA function that
      Severity: Major
      Found in includes/base_controls/QDatepickerGen.class.php - About 1 day to fix

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

        <?php    
        
            /* Custom "property" event classes for this control */
            /**
             * Type:Function( Element input, Object inst )Default:nullA function that
        Severity: Major
        Found in includes/base_controls/QDatepickerBoxGen.class.php - About 1 day to fix

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

          <?php
          
              function QcubedHandleCodeGenParseError($__exc_errno, $__exc_errstr, $__exc_errfile, $__exc_errline) {
                  $strErrorString = str_replace("SimpleXMLElement::__construct() [<a href='function.SimpleXMLElement---construct'>function.SimpleXMLElement---construct</a>]: ", '', $__exc_errstr);
                  QCodeGen::$RootErrors .= sprintf("%s\r\n", $strErrorString);
          Severity: Major
          Found in includes/codegen/QCodeGenBase.class.php - About 1 day to fix

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

                public function __set($strName, $mixValue) {
                    switch ($strName) {
                        // Styles
                        case "BackColor":
                            try {
            Severity: Major
            Found in includes/base_controls/QHtmlAttributeManagerBase.class.php - About 1 day to fix

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

                      public function __set($strName, $mixValue) {
                          switch ($strName) {
                              // APPEARANCE
                              case "BackColor": 
                                  try {
              Severity: Minor
              Found in includes/base_controls/QDataGridLegacyColumn.class.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

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

              <?php
                  if(!class_exists('QAbstractCacheProvider')){
                      include_once __QCUBED_CORE__ . '/framework/QAbstractCacheProvider.class.php';
                  }
                  
              Severity: Major
              Found in includes/framework/QDatabaseBase.class.php - About 1 day to fix

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

                        public function __set($strName, $mixValue) {
                            switch ($strName) {
                                // APPEARANCE
                                case "BackColor": 
                                    try {
                Severity: Major
                Found in includes/base_controls/QDataGridLegacyColumn.class.php - About 1 day to fix

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

                          public function __set($strName, $mixValue) {
                              switch ($strName) {
                                  // APPEARANCE
                                  case "AlternateRowStyle":
                                      try {
                  Severity: Minor
                  Found in includes/base_controls/QDataGridLegacyBase.class.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

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

                          public function __set($strName, $mixValue) {
                              switch ($strName) {
                                  // Shunt position settings to the wrapper. Actual drawing will get resolved at draw time.
                                  case "Position":
                                  case "Top":
                  Severity: Major
                  Found in includes/base_controls/QControlBase.class.php - About 1 day to fix

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

                    <?php
                    
                        // These Aid with the PHP 5.2 DateTime error handling
                        class QDateTimeNullException extends QCallerException {}
                        function QDateTimeErrorHandler() {}
                    Severity: Major
                    Found in includes/framework/QDateTime.class.php - About 1 day to fix

                      Function DisplayHtml has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                      Open

                              public static function DisplayHtml($strText, $strCssClass) {
                                  $strText = trim(str_replace("\r", '', $strText));
                                  $strToReturn = '';
                      
                                  $objStateStack = new QStack();
                      Severity: Minor
                      Found in includes/base_controls/QWriteBox.class.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

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

                              public function __construct($objSettingsXml) {
                                  parent::__construct($objSettingsXml);
                                  // Make settings file accessible to templates
                                  //$this->objSettingsXml = $objSettingsXml;
                      
                      
                      Severity: Minor
                      Found in includes/codegen/QDatabaseCodeGen.class.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

                      Severity
                      Category
                      Status
                      Source
                      Language