ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

The parameter $notify_method is not named in camelCase.
Open

function updateUser($uid, $uname, $login_name, $name, $url, $email, $user_icq, $user_aim, $user_yim,
                    $user_msnm, $user_from, $user_occ, $user_intrest, $user_viewemail, $user_avatar,
                    $user_sig, $attachsig, $theme, $pass, $pass2, $rank, $bio, $uorder, $umode, $notify_method,
                    $notify_mode, $timezone_offset, $user_mailok, $language,
                    $pass_expired, $groups = array()

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $pass_expired is not named in camelCase.
Open

function updateUser($uid, $uname, $login_name, $name, $url, $email, $user_icq, $user_aim, $user_yim,
                    $user_msnm, $user_from, $user_occ, $user_intrest, $user_viewemail, $user_avatar,
                    $user_sig, $attachsig, $theme, $pass, $pass2, $rank, $bio, $uorder, $umode, $notify_method,
                    $notify_mode, $timezone_offset, $user_mailok, $language,
                    $pass_expired, $groups = array()

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Avoid variables with short names like $i. Configured minimum length is 3.
Open

            $i = 0;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $fp. Configured minimum length is 3.
Open

        $fp = fopen($sql_cache_file , "w") ;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $i. Configured minimum length is 3.
Open

        $i = 0 ;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Avoid variables with short names like $i. Configured minimum length is 3.
Open

    $i = 0;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

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

        if (options.setTop)
            styles.top  = (p[1] + pageXY.y - delta[1] + options.offsetTop)  + 'px';
Severity: Minor
Found in htdocs/install/prototype.js and 1 other location - About 50 mins to fix
htdocs/install/prototype.js on lines 4311..4312

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

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 (options.setLeft)
            styles.left = (p[0] + pageXY.x - delta[0] + options.offsetLeft) + 'px';
Severity: Minor
Found in htdocs/install/prototype.js and 1 other location - About 50 mins to fix
htdocs/install/prototype.js on lines 4313..4314

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

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

                    if (!($atasks_handler->insert($task))) {
                        $msgs[] = sprintf('&nbsp;&nbsp;<span style="color:#ff0000;">' . _MD_AM_AUTOTASK_FAIL . '</span>', '<strong>' . $taskData['name'] . '</strong>');
                    } else {
                        $msgs[] = sprintf('&nbsp;&nbsp;' . _MD_AM_AUTOTASK_ADDED, '<strong>' . $taskData['name'] . '</strong>');
                    }
Severity: Minor
Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php and 1 other location - About 45 mins to fix
htdocs/modules/system/admin/modulesadmin/modulesadmin.php on lines 1351..1355

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

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

                    if (!($atasks_handler->insert($task))) {
                        $msgs[] = sprintf('&nbsp;&nbsp;<span style="color:#ff0000;">' . _MD_AM_AUTOTASK_FAIL . '</span>', '<strong>' . $taskData['name'] . '</strong>');
                    } else {
                        $msgs[] = sprintf('&nbsp;&nbsp;' . _MD_AM_AUTOTASK_ADDED, '<strong>' . $taskData['name'] . '</strong>');
                    }
Severity: Minor
Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php and 1 other location - About 45 mins to fix
htdocs/modules/system/admin/modulesadmin/modulesadmin.php on lines 503..507

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

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

Avoid deeply nested control flow statements.
Open

                                if ( !(unmatched[i] || setMatched[i]) ) {
                                    setMatched[i] = pop.call( results );
                                }
Severity: Major
Found in htdocs/install/prototype.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (Element.getStyle(element, 'position') == 'absolute') break;
    Severity: Major
    Found in htdocs/install/prototype.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                              if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
                                                  return false;
                                              }
      Severity: Major
      Found in htdocs/install/prototype.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                            if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
                                                if ( useCache ) {
                                                    (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
                                                }
        
        
        Severity: Major
        Found in htdocs/install/prototype.js - About 45 mins to fix

          Function isApplied has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              function isApplied()
              {
                  if (!isset($_SESSION[__CLASS__]) || !is_array($_SESSION[__CLASS__])) {
                      $_SESSION[__CLASS__] = array();
                  }
          Severity: Minor
          Found in upgrade/cnt-2.2.x-to-2.0.x/index.php - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                                  if ( !selector ) {
                                      push.apply( results, seed );
                                      return results;
                                  }
          Severity: Major
          Found in htdocs/install/prototype.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

            } else if (this.type == "vertical") { box2.style.top = (box1.offsetTop + this.position.level1.top) + "px"; if (this.browser.ie5) { box2.style.left = (box1.offsetWidth + this.position.level1.left) + "px";} else { box2.style.left = (box1.offsetLeft + box1.offsetWidth + this.position.level1.Left) + "px";}
            }
            Severity: Major
            Found in htdocs/include/icms_rtl.js - About 45 mins to fix

              Function updateContent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  updateContent: function(responseText) {
                      var receiver = this.container[this.success() ? 'success' : 'failure'],
                          options = this.options;
              
                      if (!options.evalScripts) responseText = responseText.stripScripts();
              Severity: Minor
              Found in htdocs/install/prototype.js - About 45 mins 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

              Avoid deeply nested control flow statements.
              Open

                                          if ( (elem = matcherOut[i]) ) {
                                              temp.push( (matcherIn[i] = elem) );
                                          }
              Severity: Major
              Found in htdocs/install/prototype.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if(n<=14){
                                        r = 255-(n * 17);
                                        g=b=0;
                                    }else if(n>14 && n<=28){
                                        g = 255-((n-14) * 17);
                Severity: Major
                Found in htdocs/include/color-picker.js - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language