lancew/DojoList

View on GitHub

Showing 1,940 of 1,940 total issues

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

    for (var i = 0, length = this.points.length ; i< length; i++){
        mmpoints.push(this.points[i].toMultiMap());
    }
Severity: Major
Found in js/mapstraction.js and 5 other locations - About 1 hr to fix
js/mapstraction.js on lines 4897..4899
js/mapstraction.js on lines 4949..4951
js/mapstraction.js on lines 4998..5000
js/mapstraction.js on lines 5012..5014
js/mapstraction.js on lines 5063..5065

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

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

    for (var i = 0, length = this.points.length ; i< length; i++){
        mpoints.push(this.points[i].toMicrosoft());
    }
Severity: Major
Found in js/mapstraction.js and 5 other locations - About 1 hr to fix
js/mapstraction.js on lines 4897..4899
js/mapstraction.js on lines 4972..4974
js/mapstraction.js on lines 4998..5000
js/mapstraction.js on lines 5012..5014
js/mapstraction.js on lines 5063..5065

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

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

    for (var i = 0, length = this.points.length ; i< length; i++){
        mqpoints.add(this.points[i].toMapQuest());
    }
Severity: Major
Found in js/mapstraction.js and 5 other locations - About 1 hr to fix
js/mapstraction.js on lines 4897..4899
js/mapstraction.js on lines 4949..4951
js/mapstraction.js on lines 4972..4974
js/mapstraction.js on lines 5012..5014
js/mapstraction.js on lines 5063..5065

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

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 (this.controls) {
                while ((ctl = this.controls.pop())) {
                    map.removeControl(ctl);
                }
            }
Severity: Major
Found in js/mapstraction.js and 1 other location - About 1 hr to fix
js/mapstraction.js on lines 1214..1221

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

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 (this.controls) {
                while ( (ctl = this.controls.pop()) ) {
                    map.removeControl(ctl);
                }
            }
Severity: Major
Found in js/mapstraction.js and 1 other location - About 1 hr to fix
js/mapstraction.js on lines 1078..1085

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

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

Consider simplifying this complex logical expression.
Open

        if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
            submit !== false && (!submit || key == submit) && (submitted = true)))) {
          if (key in result) {
            // a key is already present; construct an array of values
            if (!Object.isArray(result[key])) result[key] = [result[key]];
Severity: Critical
Found in js/prototype/prototype-1.6.0.3.js - About 1 hr to fix

    Avoid using short method names like ::v(). The configured minimum method name length is 3.
    Open

    function v($value, $default)
    {
      return value_or_default($value, $default);
    }
    Severity: Minor
    Found in lib/limonade.php by phpmd

    ShortMethodName

    Since: 0.2

    Detects when very short method names are used.

    Example

    class ShortMethod {
        public function a( $index ) { // Violation
        }
    }

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

    Avoid using short method names like ::js(). The configured minimum method name length is 3.
    Open

    function js($content_or_func, $layout = '', $locals = array())
    {
      send_header('Content-Type: application/javascript; charset='.strtolower(option('encoding')));
      $args = func_get_args();
      return call_user_func_array('render', $args);
    Severity: Minor
    Found in lib/limonade.php by phpmd

    ShortMethodName

    Since: 0.2

    Detects when very short method names are used.

    Example

    class ShortMethod {
        public function a( $index ) { // Violation
        }
    }

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

    Avoid using short method names like ::h(). The configured minimum method name length is 3.
    Open

    function h($str, $quote_style = ENT_NOQUOTES, $charset = null)
    {
      if(is_null($charset)) $charset = strtoupper(option('encoding'));
      return htmlspecialchars($str, $quote_style, $charset); 
    }
    Severity: Minor
    Found in lib/limonade.php by phpmd

    ShortMethodName

    Since: 0.2

    Detects when very short method names are used.

    Example

    class ShortMethod {
        public function a( $index ) { // Violation
        }
    }

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

    Function polylineCenterAndZoom has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

              case 'openstreetmap':
                  type = map.getCurrentMapType();
                  switch(type) {
                      case G_NORMAL_MAP:
                          return Mapstraction.ROAD;
      Severity: Major
      Found in js/mapstraction.js and 1 other location - About 1 hr to fix
      js/mapstraction.js on lines 2766..2778

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

      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

          this.pllID = "mspll-"+new Date().getTime()+'-'+(Math.floor(Math.random()*Math.pow(2,16)));
      Severity: Major
      Found in js/mapstraction.js and 1 other location - About 1 hr to fix
      js/mapstraction.js on lines 3899..3899

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

      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

              case 'yahoo':
                  type = map.getCurrentMapType();
                  switch(type) {
                      case YAHOO_MAP_REG:
                          return Mapstraction.ROAD;
      Severity: Major
      Found in js/mapstraction.js and 1 other location - About 1 hr to fix
      js/mapstraction.js on lines 2780..2792

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

      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

          this.pinID = "mspin-"+new Date().getTime()+'-'+(Math.floor(Math.random()*Math.pow(2,16)));
      Severity: Major
      Found in js/mapstraction.js and 1 other location - About 1 hr to fix
      js/mapstraction.js on lines 4766..4766

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

      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 respondToReadyState has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        respondToReadyState: function(readyState) {
          var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
      
          if (state == 'Complete') {
            try {
      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 compileXPathMatcher has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        compileXPathMatcher: function() {
          var e = this.expression, ps = Selector.patterns,
              x = Selector.xpath, le, m;
      
          if (Selector._cache[e]) {
      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 setOpacity has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        Element.Methods.setOpacity = function(element, value) {
          function stripAlpha(filter){
            return filter.replace(/alpha\([^\)]*\)/gi,'');
          }
          element = $(element);
      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 viewportOffset has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        viewportOffset: function(forElement) {
          var valueT = 0, valueL = 0;
      
          var element = forElement;
          do {
      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 not has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

            'not': function(m) {
              var e = m[6], p = Selector.patterns,
                  x = Selector.xpath, le, v;
      
              var exclusion = [];
      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

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

                          GEvent.addListener(this.maps[api], 'click', function(marker,location) {
                              // If the user puts their own Google markers directly on the map
                              // then there is no location and this event should not fire.
                              if ( location ) {
                                  me.clickHandler(location.y,location.x,location,me);
      Severity: Major
      Found in js/mapstraction.js and 1 other location - About 1 hr to fix
      js/mapstraction.js on lines 459..465

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

      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