lancew/DojoList

View on GitHub

Showing 1,940 of 1,940 total issues

Avoid excessively long variable names like $no_slash_asterisk_subpattern. Keep variable name length under 20.
Open

  $no_slash_asterisk_subpattern = "(?:([^\/]*))?";
Severity: Minor
Found in lib/limonade.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

Avoid excessively long variable names like $double_asterisk_subpattern. Keep variable name length under 20.
Open

  $double_asterisk_subpattern   = "(?:/(.*))?";
Severity: Minor
Found in lib/limonade.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

Avoid excessively long variable names like $path_as_no_question_mark. Keep variable name length under 20.
Open

    $path_as_no_question_mark = strpos($path, '?') === false;
Severity: Minor
Found in lib/limonade.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

Avoid excessively long variable names like $optionnal_slash_subpattern. Keep variable name length under 20.
Open

  $optionnal_slash_subpattern   = "(?:/*?)";
Severity: Minor
Found in lib/limonade.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

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

    'disabled': function(nodes, value, root) {
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        if (node.disabled) results.push(node);
      return results;
    },
Severity: Major
Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 1 hr to fix
js/prototype/prototype-1.6.0.3.js on lines 3369..3373

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

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

    'checked': function(nodes, value, root) {
      for (var i = 0, results = [], node; node = nodes[i]; i++)
        if (node.checked) results.push(node);
      return results;
    }
Severity: Major
Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 1 hr to fix
js/prototype/prototype-1.6.0.3.js on lines 3363..3367

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

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

Mapstraction.prototype.visibleCenterAndZoom = function()
{
    if(this.loaded[this.api] == false)
    {
        myself = this;
Severity: Minor
Found in js/mapstraction.js - About 1 hr to fix

    Function getElementsByClassName has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
      function iter(name) {
        return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
      }
    
    
    Severity: Minor
    Found in js/prototype/prototype-1.6.0.3.js - About 1 hr 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 setStyle has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      setStyle: function(element, styles) {
        element = $(element);
        var elementStyle = element.style, match;
        if (Object.isString(styles)) {
          element.style.cssText += ';' + styles;
    Severity: Minor
    Found in js/prototype/prototype-1.6.0.3.js - About 1 hr 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 setRequestHeaders has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      setRequestHeaders: function() {
        var headers = {
          'X-Requested-With': 'XMLHttpRequest',
          'X-Prototype-Version': Prototype.Version,
          'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
    Severity: Minor
    Found in js/prototype/prototype-1.6.0.3.js - About 1 hr 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 select has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

      select: function(element, value) {
        if (Object.isUndefined(value))
          return this[element.type == 'select-one' ?
            'selectOne' : 'selectMany'](element);
        else {
    Severity: Minor
    Found in js/prototype/prototype-1.6.0.3.js - About 1 hr 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 Validate_form has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    function Validate_form($post = null)
    {
        // echo '<pre>';
        // print_r($_POST);
        // echo '</pre>';
    Severity: Minor
    Found in lib/data.model.php - About 1 hr 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 getZoomLevelForBoundingBox has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Mapstraction.prototype.getZoomLevelForBoundingBox = function( bbox ) {
        if(this.loaded[this.api] === false) {
            var me = this;
            return -1;
        }
    Severity: Minor
    Found in js/mapstraction.js - About 1 hr to fix

      Method error_handler_dispatcher has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function error_handler_dispatcher($errno, $errstr, $errfile, $errline)
      {
        $back_trace = debug_backtrace();
        while($trace = array_shift($back_trace))
        {
      Severity: Minor
      Found in lib/limonade.php - About 1 hr to fix

        Method Admin_Create_kml has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Admin_Create_kml() 
        {
            $xml = Find_Dojo_all();
        
            $newKML = '<?xml version="1.0" encoding="UTF-8"?>
        Severity: Minor
        Found in controllers/admin.php - About 1 hr to fix

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

                  case 'viamichelin':
                      var vmpin = marker.toViaMichelin();
                      marker.setChild(vmpin);
                      map.addLayer(vmpin);
                      if (!old) {
          Severity: Major
          Found in js/mapstraction.js and 6 other locations - About 1 hr to fix
          js/mapstraction.js on lines 1585..1592
          js/mapstraction.js on lines 1594..1601
          js/mapstraction.js on lines 1667..1674
          js/mapstraction.js on lines 1683..1690
          js/mapstraction.js on lines 1691..1698
          js/mapstraction.js on lines 1991..1998

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

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

                  case 'mapquest':
                      var mqpin = marker.toMapQuest();
                      marker.setChild(mqpin);
                      map.addPoi(mqpin);
                      if (!old) {
          Severity: Major
          Found in js/mapstraction.js and 6 other locations - About 1 hr to fix
          js/mapstraction.js on lines 1585..1592
          js/mapstraction.js on lines 1594..1601
          js/mapstraction.js on lines 1667..1674
          js/mapstraction.js on lines 1691..1698
          js/mapstraction.js on lines 1699..1706
          js/mapstraction.js on lines 1991..1998

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

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

                  case 'freeearth':
                      var fepin = marker.toFreeEarth();
                      marker.setChild(fepin);
                      map.addOverlay(fepin);
                      if (!old) {
          Severity: Major
          Found in js/mapstraction.js and 6 other locations - About 1 hr to fix
          js/mapstraction.js on lines 1585..1592
          js/mapstraction.js on lines 1594..1601
          js/mapstraction.js on lines 1667..1674
          js/mapstraction.js on lines 1683..1690
          js/mapstraction.js on lines 1699..1706
          js/mapstraction.js on lines 1991..1998

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

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

                  case 'openspace' :
                      this.currentElement.style.width = width;
                      this.currentElement.style.height = height;
                      this.maps[this.api].updateSize();
                      break;
          Severity: Major
          Found in js/mapstraction.js and 3 other locations - About 1 hr to fix
          js/mapstraction.js on lines 857..861
          js/mapstraction.js on lines 867..871
          js/mapstraction.js on lines 875..879

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

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

                  case 'yahoo':
                      var ypin = marker.toYahoo();
                      marker.setChild(ypin);
                      map.addOverlay(ypin);
                      if (!old) {
          Severity: Major
          Found in js/mapstraction.js and 6 other locations - About 1 hr to fix
          js/mapstraction.js on lines 1594..1601
          js/mapstraction.js on lines 1667..1674
          js/mapstraction.js on lines 1683..1690
          js/mapstraction.js on lines 1691..1698
          js/mapstraction.js on lines 1699..1706
          js/mapstraction.js on lines 1991..1998

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

          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