qcubed/framework

View on GitHub

Showing 15,774 of 15,774 total issues

Similar blocks of code found in 2 locations. 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 and 1 other location - About 1 mo to fix
includes/base_controls/QDatepickerGen.class.php on lines 1..1291

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

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    

    /* 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 and 1 other location - About 1 mo to fix
includes/base_controls/QDatepickerBoxGen.class.php on lines 1..1291

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

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 jquery-ui.custom.js has 12461 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! jQuery UI - v1.11.1 - 2014-09-21
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, menu.js, progressbar.js, selectmenu.js, slider.js, spinner.js, tabs.js, tooltip.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */

Severity: Major
Found in assets/js/jquery/jquery-ui.custom.js - About 1 mo to fix

    File jquery.js has 6829 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.11.1
     * http://jquery.com/
     *
     * Includes Sizzle.js
    Severity: Major
    Found in assets/js/jquery/jquery.js - About 2 wks to fix

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

      <?php
      require('jq_control.php');
          require('qcubed.inc.php');
      
      class HtmlJqDoc extends JqDoc {
      Severity: Major
      Found in assets/php/_devtools/jquery_ui_gen/jq_control_gen-v1.9.php and 1 other location - About 1 wk to fix
      assets/php/_devtools/jquery_ui_gen/jq_control_gen-1.10.php on lines 1..265

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

      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('jq_control.php');
          require('qcubed.inc.php');
      
      class HtmlJqDoc extends JqDoc {
      Severity: Major
      Found in assets/php/_devtools/jquery_ui_gen/jq_control_gen-1.10.php and 1 other location - About 1 wk to fix
      assets/php/_devtools/jquery_ui_gen/jq_control_gen-v1.9.php on lines 1..265

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

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

      (function( window ) {
      
      var i,
          support,
          Expr,
      Severity: Major
      Found in assets/js/jquery/jquery.js - About 6 days to fix

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

        <?php    
            /**
             * Triggered when the button is created.
             * 
             *     * event Type: Event 
        Severity: Major
        Found in includes/base_controls/QJqCheckBoxGen.class.php and 2 other locations - About 6 days to fix
        includes/base_controls/QJqButtonGen.class.php on lines 1..295
        includes/base_controls/QJqRadioButtonGen.class.php on lines 1..295

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

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

        <?php    
            /**
             * Triggered when the button is created.
             * 
             *     * event Type: Event 
        Severity: Major
        Found in includes/base_controls/QJqButtonGen.class.php and 2 other locations - About 6 days to fix
        includes/base_controls/QJqCheckBoxGen.class.php on lines 1..295
        includes/base_controls/QJqRadioButtonGen.class.php on lines 1..295

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

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

        <?php    
            /**
             * Triggered when the button is created.
             * 
             *     * event Type: Event 
        Severity: Major
        Found in includes/base_controls/QJqRadioButtonGen.class.php and 2 other locations - About 6 days to fix
        includes/base_controls/QJqButtonGen.class.php on lines 1..295
        includes/base_controls/QJqCheckBoxGen.class.php on lines 1..295

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

        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 QQuery.class.php has 1814 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
            /*
            *    QQuery.class.php
            *
        Severity: Major
        Found in includes/framework/QQuery.class.php - About 4 days to fix

          Function TriggerActions has a Cognitive Complexity of 225 (exceeds 5 allowed). Consider refactoring.
          Open

                  protected function TriggerActions($strControlIdOverride = null) {
                      if (array_key_exists('Qform__FormControl', $_POST)) {
                          if ($strControlIdOverride) {
                              $strControlId = $strControlIdOverride;
                          } else {
          Severity: Minor
          Found in includes/base_controls/QFormBase.class.php - About 4 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 AnalyzeTable has a Cognitive Complexity of 180 (exceeds 5 allowed). Consider refactoring.
          Open

                  protected function AnalyzeTable(QSqlTable $objTable) {
                      // Setup the Table Object
                      $objTable->OwnerDbIndex = $this->intDatabaseIndex;
                      $strTableName = $objTable->Name;
                      $objTable->ClassName = $this->ModelClassName($strTableName);
          Severity: Minor
          Found in includes/codegen/QDatabaseCodeGen.class.php - About 3 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 has too many statements (260). Maximum allowed is 30.
          Open

          }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
          Severity: Minor
          Found in assets/js/jquery/jquery.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

                  protected function MakeJqOptions() {
                      $jqOptions = null;
                      if (!is_null($val = $this->AlsoResize)) {$jqOptions['alsoResize'] = $val;}
                      if (!is_null($val = $this->Animate)) {$jqOptions['animate'] = $val;}
                      if (!is_null($val = $this->AnimateDuration)) {$jqOptions['animateDuration'] = $val;}
          Severity: Major
          Found in includes/base_controls/QResizableGen.class.php and 1 other location - About 3 days to fix
          includes/base_controls/QDialogGen.class.php on lines 357..379

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

          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->AppendTo)) {$jqOptions['appendTo'] = $val;}
                      if (!is_null($val = $this->AutoOpen)) {$jqOptions['autoOpen'] = $val;}
                      if (!is_null($val = $this->Buttons)) {$jqOptions['buttons'] = $val;}
          Severity: Major
          Found in includes/base_controls/QDialogGen.class.php and 1 other location - About 3 days to fix
          includes/base_controls/QResizableGen.class.php on lines 267..289

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

          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 QControlBase.class.php has 1201 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
              /**
               * QControlBase is the base class of all QControls and shares their common properties.
               * 
               * Not every control will utilize every single one of these properties.
          Severity: Major
          Found in includes/base_controls/QControlBase.class.php - About 3 days to fix

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

                private function ParseForInnoDbForeignKeys($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 starts with "CONSTRAINT" and contains "FOREIGN 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 328..380

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

            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 ParseForInnoDbForeignKeys($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 starts with "CONSTRAINT" and contains "FOREIGN 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 492..544

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

            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 QDataGridLegacyBase.class.php has 1026 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
                /**
                 * This file contains the QDataGridBase and QDataGridRow class.
                 *
                 * @package Controls
            Severity: Major
            Found in includes/base_controls/QDataGridLegacyBase.class.php - About 2 days to fix
              Severity
              Category
              Status
              Source
              Language