qcubed/framework

View on GitHub

Showing 2,378 of 15,774 total issues

Function RenderActions has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

        public static function RenderActions(QControl $objControl, $strEventName, $objActions) {
            $strToReturn = '';
            $strJqUiProperty = null;

            if ($objControl->ActionsMustTerminate) {
Severity: Minor
Found in includes/base_controls/_actions.inc.php - About 5 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 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($mixFieldData, $objDb = null) {
        $objDatabaseRow = null;
        
        $objDatabaseRow = $mixFieldData ; // BG New 
                
Severity: Minor
Found in includes/database/QInformixPdoDatabase.class.php - About 5 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 34 (exceeds 5 allowed). Consider refactoring.
Open

        public function __construct($mixFieldData, $objDb = null) {
            $objDatabaseRow = null;
            try {
                $objDatabaseRow = QType::Cast($mixFieldData, 'QSqlServer2005DatabaseRow');
            } catch (QInvalidCastException $objExc) {
Severity: Minor
Found in includes/database/QSqlServer2005Database.class.php - About 5 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 ParsePoData has 126 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function ParsePoData($strPoData) {
        $strPoData = str_replace("\r", '', trim($strPoData));
        $strPoLines = explode("\n", $strPoData);

        $strMatches = array();
Severity: Major
Found in includes/framework/QTranslationPoParser.class.php - About 5 hrs to fix

    Consider simplifying this complex logical expression.
    Open

                if ( event.pageX == null && original.clientX != null ) {
                    eventDoc = event.target.ownerDocument || document;
                    doc = eventDoc.documentElement;
                    body = eventDoc.body;
    
    
    Severity: Critical
    Found in assets/js/jquery/jquery.js - About 5 hrs to fix

      QDateTime has 38 functions (exceeds 20 allowed). Consider refactoring.
      Open

          class QDateTime extends DateTime implements JsonSerializable, Serializable {
              /** Used to specify the time right now (used when creating new instances of this class) */
              const Now = 'now';
              /** Date and time in ISO format */
              const FormatIso = 'YYYY-MM-DD hhhh:mm:ss';
      Severity: Minor
      Found in includes/framework/QDateTime.class.php - About 5 hrs to fix

        QDatabaseBase has 38 functions (exceeds 20 allowed). Consider refactoring.
        Open

            abstract class QDatabaseBase extends QBaseClass {
                // Must be updated for all Adapters
                /** Adapter name */
                const Adapter = 'Generic Database Adapter (Abstract)';
        
        
        Severity: Minor
        Found in includes/framework/QDatabaseBase.class.php - About 5 hrs to fix

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

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

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

                    public function __construct($mixFieldData, $objDb = null) {
                        $this->strName = $mixFieldData->GetColumn('column_name');
                        $this->strOriginalName = $this->strName;
                        $this->strTable = $mixFieldData->GetColumn('table_name');
                        $this->strOriginalTable = $this->strTable;
            Severity: Minor
            Found in includes/database/QPostgreSqlDatabase.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 jquery-migrate.js has 371 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*!
             * jQuery Migrate - v1.1.1 - 2013-02-16
             * https://github.com/jquery/jquery-migrate
             * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
             */
            Severity: Minor
            Found in assets/js/jquery/jquery-migrate.js - About 4 hrs to fix

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

                      public function __construct($mixFieldData, $objDb = null) {
                              $this->strName = $mixFieldData->GetColumn('column_name');
                              $this->strOriginalName = $this->strName;
                              $this->strTable = $mixFieldData->GetColumn('table_name');
                              $this->strOriginalTable = $this->strTable;
              Severity: Major
              Found in includes/database/QPostgreSqlPdoDatabase.class.php - About 4 hrs to fix

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

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

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

                          public function __construct($mixFieldData, $objDb = null) {
                              $objDatabaseRow = null;
                              try {
                                  $objDatabaseRow = QType::Cast($mixFieldData, 'QSqlServer2005DatabaseRow');
                              } catch (QInvalidCastException $objExc) {
                  Severity: Major
                  Found in includes/database/QSqlServer2005Database.class.php - About 4 hrs to fix

                    Function processImmediateAjaxResponse has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                    Open

                        processImmediateAjaxResponse: function(json, qFormParams) {
                            if (json.controls) $j.each(json.controls, function() {
                                var strControlId = '#' + this.id,
                                    control = $j(strControlId),
                                    wrapper = $j(strControlId + '_ctl');
                    Severity: Minor
                    Found in assets/js/qcubed.js - 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 Save has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                    Open

                            public static function Save($strFormState, $blnBackButtonFlag) {
                                // Compress (if available)
                                if (function_exists('gzcompress'))
                                    $strFormState = gzcompress($strFormState, 9);
                                    
                    Severity: Minor
                    Found in includes/qform_state_handlers/QSessionFormStateHandler.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

                    Method RemoveAccents has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public static function RemoveAccents($strString) {
                                if (!preg_match('/[\x80-\xff]/', $strString))
                                    return $strString;
                    
                                if (self::IsUtf8($strString)) {
                    Severity: Major
                    Found in includes/framework/QString.class.php - About 4 hrs to fix

                      Function _create has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _create: function() {
                              this.element.closest( "form" )
                                  .unbind( "reset" + this.eventNamespace )
                                  .bind( "reset" + this.eventNamespace, formResetHandler );
                      
                      
                      Severity: Major
                      Found in assets/js/jquery/jquery-ui.custom.js - About 4 hrs to fix

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

                                public function __construct($objSettingsXml) {
                                    parent::__construct($objSettingsXml);
                                    // Make settings file accessible to templates
                                    //$this->objSettingsXml = $objSettingsXml;
                        
                        
                        Severity: Major
                        Found in includes/codegen/QDatabaseCodeGen.class.php - About 4 hrs to fix

                          Function RenderOutput has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  protected function RenderOutput($strOutput, $blnDisplayOutput, $blnForceAsBlockElement = false) {
                                      if ($blnForceAsBlockElement) {
                                          $this->blnIsBlockElement = true;    // must be remembered for ajax drawing
                                      }
                          
                          
                          Severity: Minor
                          Found in includes/base_controls/QControlBase.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

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

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

                          Severity
                          Category
                          Status
                          Source
                          Language