qcubed/framework

View on GitHub

Showing 15,774 of 15,774 total issues

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

<?php
    require(__QCUBED_CORE__ . '/codegen/QSqlColumn.class.php');
    require(__QCUBED_CORE__ . '/codegen/QIndex.class.php');
    require(__QCUBED_CORE__ . '/codegen/QManyToManyReference.class.php');
    require(__QCUBED_CORE__ . '/codegen/QReference.class.php');
Severity: Major
Found in includes/codegen/QDatabaseCodeGen.class.php - About 2 days to fix

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

    <?php
        /**
         * This file contains the QFormBase class.
         *
         * @package Controls
    Severity: Major
    Found in includes/base_controls/QFormBase.class.php - About 2 days to fix

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

      <?php
      require_once('../qcubed.inc.php');
      
      class CalculatorForm extends QForm {
      
      
      Severity: Major
      Found in assets/php/examples/basic_ajax/calculator_2.php and 1 other location - About 2 days to fix
      assets/php/examples/basic_qform/calculator_2.php on lines 1..93

      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 496.

      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

      <?php
      require_once('../qcubed.inc.php');
      
      class CalculatorForm extends QForm {
      
      
      Severity: Major
      Found in assets/php/examples/basic_qform/calculator_2.php and 1 other location - About 2 days to fix
      assets/php/examples/basic_ajax/calculator_2.php on lines 1..90

      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 496.

      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

      Function Send has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
      Open

              public static function Send(QEmailMessage $objMessage) {
                  $objResource = null;
      
                  if (QEmailServer::$TestMode) {
                      // Open up a File Resource to the TestModeDirectory
      Severity: Minor
      Found in includes/framework/QEmailServer.class.php - About 2 days 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 Run has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
      Open

              public static function Run($strFormClass, $strAlternateHtmlFile = null, $strFormId = null) {
                  // See if we can get a Form Class out of PostData
                  $objClass = null;
                  if ($strFormId === null) {
                      $strFormId = $strFormClass;
      Severity: Minor
      Found in includes/base_controls/QFormBase.class.php - About 2 days 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 QHtmlTableColumn.class.php has 941 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
          /**
           * Represents a column for a QHtmlTable. Different subclasses (see below) allow accessing and fetching the data
           * for each cells in a variety of ways
      Severity: Major
      Found in includes/base_controls/QHtmlTableColumn.class.php - About 2 days to fix

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

                $objCaseArray = array( 
                    array(
                        "Value" => "0", "Expected" => "0;", "Msg" => "String zero renders with no 'px'"
                    ),
                    array(
        Severity: Major
        Found in includes/tests/qcubed-unit/QControlBaseTest.php and 1 other location - About 2 days to fix
        includes/tests/qcubed-unit/QCssTest.php on lines 21..93

        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 461.

        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

                $objCaseArray = array( 
                    array(
                        "Value" => "0", "Expected" => "0", "Msg" => "String zero renders with no 'px'"
                    ),
                    array(
        Severity: Major
        Found in includes/tests/qcubed-unit/QCssTest.php and 1 other location - About 2 days to fix
        includes/tests/qcubed-unit/QControlBaseTest.php on lines 44..116

        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 461.

        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

        Function ParsePoData has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function ParsePoData($strPoData) {
                $strPoData = str_replace("\r", '', trim($strPoData));
                $strPoLines = explode("\n", $strPoData);
        
                $strMatches = array();
        Severity: Minor
        Found in includes/framework/QTranslationPoParser.class.php - About 2 days 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 qcubed.js has 917 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // BEWARE: this clears the $ variable!
        var $j = jQuery.noConflict(),
            qcubed,
            qc;
        
        
        Severity: Major
        Found in assets/js/qcubed.js - About 2 days to fix

          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/QPostgreSqlPdoDatabase.class.php and 1 other location - About 2 days to fix
          includes/database/QPostgreSqlDatabase.class.php on lines 419..492

          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 435.

          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/QPostgreSqlDatabase.class.php and 1 other location - About 2 days to fix
          includes/database/QPostgreSqlPdoDatabase.class.php on lines 324..397

          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 435.

          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 419 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public function __set($strName, $mixValue) {
                      switch ($strName) {
                          case 'AltField':
                              $this->mixAltField = $mixValue;
                              $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'altField', $mixValue);
          Severity: Major
          Found in includes/base_controls/QDatepickerGen.class.php - About 2 days to fix

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

                    public function __set($strName, $mixValue) {
                        switch ($strName) {
                            case 'AltField':
                                $this->mixAltField = $mixValue;
                                $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'altField', $mixValue);
            Severity: Major
            Found in includes/base_controls/QDatepickerBoxGen.class.php - About 2 days to fix

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

                  private function ParseForIndexes($strCreateStatement) {
                      // MySql nicely splits each object in a table into it's own line
                      // Split the create statement into lines, and then pull out anything
                      // that says "PRIMARY KEY", "UNIQUE KEY", or just plain ol' "KEY"
                      $strLineArray = explode("\n", $strCreateStatement);
              Severity: Major
              Found in includes/database/QOracleDatabase.class.php and 1 other location - About 2 days to fix
              includes/database/QMySqliDatabase.class.php on lines 278..326

              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 425.

              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 2 locations. Consider refactoring.
              Open

                      private function ParseForIndexes($strCreateStatement) {
                          // MySql nicely splits each object in a table into it's own line
                          // Split the create statement into lines, and then pull out anything
                          // that says "PRIMARY KEY", "UNIQUE KEY", or just plain ol' "KEY"
                          $strLineArray = explode("\n", $strCreateStatement);
              Severity: Major
              Found in includes/database/QMySqliDatabase.class.php and 1 other location - About 2 days to fix
              includes/database/QOracleDatabase.class.php on lines 444..490

              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 425.

              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

              Function SetupSoapMethods has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
              Open

                      protected function SetupSoapMethods(ReflectionClass $objReflection) {
                          $objReflectionMethods = $objReflection->getMethods();
                          if ($objReflectionMethods) foreach ($objReflectionMethods as $objReflectionMethod) {
                              if ($objReflectionMethod->isPublic() && !$objReflectionMethod->isAbstract() &&
                                  !$objReflectionMethod->isStatic() &&  !$objReflectionMethod->isConstructor() &&
              Severity: Minor
              Found in includes/framework/QSoapService.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 96 (exceeds 5 allowed). Consider refactoring.
              Open

                      public function __set($strName, $mixValue) {
                          switch ($strName) {
                              case 'AltField':
                                  $this->mixAltField = $mixValue;
                                  $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'altField', $mixValue);
              Severity: Minor
              Found in includes/base_controls/QDatepickerGen.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 96 (exceeds 5 allowed). Consider refactoring.
              Open

                      public function __set($strName, $mixValue) {
                          switch ($strName) {
                              case 'AltField':
                                  $this->mixAltField = $mixValue;
                                  $this->AddAttributeScript($this->getJqSetupFunction(), 'option', 'altField', $mixValue);
              Severity: Minor
              Found in includes/base_controls/QDatepickerBoxGen.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