qcubed/framework

View on GitHub

Showing 15,774 of 15,774 total issues

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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            class QQConditionIn extends QQConditionComparison {
                /**
                 * @param QQColumnNode $objQueryNode
                 * @param mixed $mixValuesArray
                 * @throws Exception
        Severity: Major
        Found in includes/framework/QQuery.class.php and 1 other location - About 1 day to fix
        includes/framework/QQuery.class.php on lines 1075..1122

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 330.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            class QQConditionNotIn extends QQConditionComparison {
                /**
                 * @param QQColumnNode $objQueryNode
                 * @param mixed|null $mixValuesArray
                 * @throws Exception
        Severity: Major
        Found in includes/framework/QQuery.class.php and 1 other location - About 1 day to fix
        includes/framework/QQuery.class.php on lines 1025..1073

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 330.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if ( data.collisionWidth > outerWidth ) {
                            // element is initially over the left side of within
                            if ( overLeft > 0 && overRight <= 0 ) {
                                newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
                                position.left += overLeft - newOverRight;
            Severity: Major
            Found in assets/js/jquery/jquery-ui.custom.js and 1 other location - About 1 day to fix
            assets/js/jquery/jquery-ui.custom.js on lines 1378..1403

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 256.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                        if ( data.collisionHeight > outerHeight ) {
                            // element is initially over the top of within
                            if ( overTop > 0 && overBottom <= 0 ) {
                                newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
                                position.top += overTop - newOverBottom;
            Severity: Major
            Found in assets/js/jquery/jquery-ui.custom.js and 1 other location - About 1 day to fix
            assets/js/jquery/jquery-ui.custom.js on lines 1341..1366

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 256.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                    private function ParseColumnNameArrayFromKeyDefinition($strKeyDefinition) {
                            $strKeyDefinition = trim($strKeyDefinition);
            
                            // Get rid of the opening "(" and the closing ")"
                            $intPosition = strpos($strKeyDefinition, '(');
            Severity: Major
            Found in includes/database/QPostgreSqlPdoDatabase.class.php and 2 other locations - About 1 day to fix
            includes/database/QInformixPdoDatabase.class.php on lines 325..355
            includes/database/QPostgreSqlDatabase.class.php on lines 348..378

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 307.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                    private function ParseColumnNameArrayFromKeyDefinition($strKeyDefinition) {
                        $strKeyDefinition = trim($strKeyDefinition);
                        
                        // Get rid of the opening "(" and the closing ")"
                        $intPosition = strpos($strKeyDefinition, '(');
            Severity: Major
            Found in includes/database/QPostgreSqlDatabase.class.php and 2 other locations - About 1 day to fix
            includes/database/QInformixPdoDatabase.class.php on lines 325..355
            includes/database/QPostgreSqlPdoDatabase.class.php on lines 253..283

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 307.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 3 locations. Consider refactoring.
            Open

                    private function ParseColumnNameArrayFromKeyDefinition($strKeyDefinition) {
                            $strKeyDefinition = trim($strKeyDefinition);
            
                            // Get rid of the opening "(" and the closing ")"
                            $intPosition = strpos($strKeyDefinition, '(');
            Severity: Major
            Found in includes/database/QInformixPdoDatabase.class.php and 2 other locations - About 1 day to fix
            includes/database/QPostgreSqlDatabase.class.php on lines 348..378
            includes/database/QPostgreSqlPdoDatabase.class.php on lines 253..283

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 307.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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 has too many statements (106). Maximum allowed is 30.
              Open

              }(function( $ ) {
              Severity: Minor
              Found in assets/js/jquery/jquery-ui.custom.js by eslint

              enforce a maximum number of statements allowed in function blocks (max-statements)

              The max-statements rule allows you to specify the maximum number of statements allowed in a function.

              function foo() {
                var bar = 1; // one statement
                var baz = 2; // two statements
                var qux = 3; // three statements
              }

              Rule Details

              This rule enforces a maximum number of statements allowed in function blocks.

              Options

              This rule has a number or object option:

              • "max" (default 10) enforces a maximum number of statements allows in function blocks

              Deprecated: The object property maximum is deprecated; please use the object property max instead.

              This rule has an object option:

              • "ignoreTopLevelFunctions": true ignores top-level functions

              max

              Examples of incorrect code for this rule with the default { "max": 10 } option:

              /*eslint max-statements: ["error", 10]*/
              /*eslint-env es6*/
              
              function foo() {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
              
                var foo11 = 11; // Too many.
              }
              
              let foo = () => {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
              
                var foo11 = 11; // Too many.
              };

              Examples of correct code for this rule with the default { "max": 10 } option:

              /*eslint max-statements: ["error", 10]*/
              /*eslint-env es6*/
              
              function foo() {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
                return function () {
              
                  // The number of statements in the inner function does not count toward the
                  // statement maximum.
              
                  return 42;
                };
              }
              
              let foo = () => {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
                return function () {
              
                  // The number of statements in the inner function does not count toward the
                  // statement maximum.
              
                  return 42;
                };
              }

              ignoreTopLevelFunctions

              Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

              /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
              
              function foo() {
                var foo1 = 1;
                var foo2 = 2;
                var foo3 = 3;
                var foo4 = 4;
                var foo5 = 5;
                var foo6 = 6;
                var foo7 = 7;
                var foo8 = 8;
                var foo9 = 9;
                var foo10 = 10;
                var foo11 = 11;
              }

              Related Rules

              • [complexity](complexity.md)
              • [max-depth](max-depth.md)
              • [max-len](max-len.md)
              • [max-nested-callbacks](max-nested-callbacks.md)
              • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      public function GetForeignKeysForTable($strTableName) {
                          $objForeignKeyArray = array();
                          
                          // Use Query to pull the FKs
                          $strQuery = sprintf('
              Severity: Major
              Found in includes/database/QSqlServerDatabase.class.php and 1 other location - About 1 day to fix
              includes/database/QSqlServer2005Database.class.php on lines 458..521

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 296.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      protected function MakeJqOptions() {
                          $jqOptions = null;
                          if (!is_null($val = $this->Animate)) {$jqOptions['animate'] = $val;}
                          if (!is_null($val = $this->Disabled)) {$jqOptions['disabled'] = $val;}
                          if (!is_null($val = $this->Max)) {$jqOptions['max'] = $val;}
              Severity: Major
              Found in includes/base_controls/QSliderGen.class.php and 1 other location - About 1 day to fix
              includes/base_controls/QSpinnerGen.class.php on lines 186..198

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 296.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      protected function MakeJqOptions() {
                          $jqOptions = null;
                          if (!is_null($val = $this->Culture)) {$jqOptions['culture'] = $val;}
                          if (!is_null($val = $this->Disabled)) {$jqOptions['disabled'] = $val;}
                          if (!is_null($val = $this->Icons)) {$jqOptions['icons'] = $val;}
              Severity: Major
              Found in includes/base_controls/QSpinnerGen.class.php and 1 other location - About 1 day to fix
              includes/base_controls/QSliderGen.class.php on lines 174..186

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 296.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      public function GetForeignKeysForTable($strTableName) {
                          $objForeignKeyArray = array();
              
                          // Use Query to pull the FKs
                          $strQuery = sprintf("
              Severity: Major
              Found in includes/database/QSqlServer2005Database.class.php and 1 other location - About 1 day to fix
              includes/database/QSqlServerDatabase.class.php on lines 383..462

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 296.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language