lancew/DojoList

View on GitHub

Showing 1,940 of 1,940 total issues

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

        case 'openstreetmap':
          if(options != null && options['pan']) { map.panTo(point.toGoogle()); }
          else { map.setCenter(point.toGoogle()); }
          break;
Severity: Major
Found in js/mapstraction.js and 1 other location - About 1 hr to fix
js/mapstraction.js on lines 2225..2228

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

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 'map24':
            var m24pin = marker.toMap24();
            marker.setChild(m24pin);
            m24pin.commit();
            if (!old) {
Severity: Major
Found in js/mapstraction.js and 1 other location - About 1 hr to fix
js/mapstraction.js on lines 1983..1990

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

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 'map24':
            var m24polyline = polyline.toMap24();
            polyline.setChild(m24polyline);
            m24polyline.commit();
            if(!old) {
Severity: Major
Found in js/mapstraction.js and 1 other location - About 1 hr to fix
js/mapstraction.js on lines 1675..1682

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method assert_header has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function assert_header($response, $expected_name, $expected_value = null, $message = "expected header '%s' to be equal to '%s' but received '%s: %s'")
{
  test_run_assertion();
  # see assert_header in http://github.com/fnando/voodoo-test/blob/f3b0994ef138a6ba94d5e7cef6c1fb1720797a86/lib/assertions.php
  $headers = preg_split("/^\s*$/ms", $response);
Severity: Minor
Found in lib/limonade/assertions.php - About 1 hr to fix

    Function concat has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      Array.prototype.concat = function() {
        var array = [];
        for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
        for (var i = 0, length = arguments.length; i < length; i++) {
          if (Object.isArray(arguments[i])) {
    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 compileMatcher has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      compileMatcher: function() {
        var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
            c = Selector.criteria, le, p, 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 stop_and_exit has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    function stop_and_exit($exit = true)
    {
      call_if_exists('before_exit', $exit);
      $headers = headers_list();
      if(request_is_head())
    Severity: Minor
    Found in lib/limonade.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 getZoom has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method ImportNewerFarDojo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function ImportNewerFarDojo($file)
      {
          $farxml = LoadFarXML($file);
          $localxml = Load_Xml_data();
          
      Severity: Minor
      Found in lib/sync.model.php - About 1 hr to fix

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

            lat = 180/Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180)) - Math.PI / 2);
        Severity: Major
        Found in js/mapstraction.js and 1 other location - About 1 hr to fix
        js/mapstraction.js on lines 5177..5177

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

        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 'map24':
                    // don't think map24 has a specific method for this
                    var current_marker;
                    while(this.markers.length > 0) {
                        current_marker = this.markers.pop();
        Severity: Major
        Found in js/mapstraction.js and 1 other location - About 1 hr to fix
        js/mapstraction.js on lines 2106..2113

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

        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.iconSize) {
                size = new OpenLayers.Size(this.iconSize[0], this.iconSize[1]);
            }
            else {
                size = new OpenLayers.Size(21,25);
        Severity: Major
        Found in js/mapstraction.js and 1 other location - About 1 hr to fix
        js/mapstraction.js on lines 4281..4286

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

        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 'map24':
                    // don't think map24 has a specific method for this
                    var current_polyline;
                    while(this.polylines.length > 0) {
                        current_polyline = this.polylines.pop();
        Severity: Major
        Found in js/mapstraction.js and 1 other location - About 1 hr to fix
        js/mapstraction.js on lines 1822..1829

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

        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.iconSize) {
                size = new OpenLayers.Size(this.iconSize[0], this.iconSize[1]);
            }
            else {
                size = new OpenLayers.Size(20,25);
        Severity: Major
        Found in js/mapstraction.js and 1 other location - About 1 hr to fix
        js/mapstraction.js on lines 4206..4211

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

        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

                                lat = (180/Math.PI)*(2*Math.atan(Math.exp(lat*Math.PI/180))-(Math.PI/2));
        Severity: Major
        Found in js/mapstraction.js and 1 other location - About 1 hr to fix
        js/mapstraction.js on lines 3662..3662

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

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

        function KMLparser(path,map){ //path: url to the kml file. map: div where the map is
           var request = GXmlHttp.create();
           request.open('GET', path, true);
           request.onreadystatechange = function(){        
                if (request.readyState == 4){
        Severity: Minor
        Found in js/KMLparser.js - About 1 hr to fix

          Method Validate_field has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Validate_field($data, $type)
          {
              // This function checks fields and returns the number of errors found.
              // Check if the parameters have been sent.
              //if(!$data or !$type) { return 1;}
          Severity: Minor
          Found in lib/data.model.php - About 1 hr to fix

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

                for (var i = 0, length = this.points.length ; i< length; i++){
                    vmpoints.push(this.points[i].toViaMichelin());
                }
            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 4998..5000
            js/mapstraction.js on lines 5012..5014

            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++){
                    fepoints.push(this.points[i].toFreeEarth());
                }
            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 4998..5000
            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++){
                    gpoints.push(this.points[i].toGoogle());
                }
            Severity: Major
            Found in js/mapstraction.js and 5 other locations - About 1 hr to fix
            js/mapstraction.js on lines 4949..4951
            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

            Severity
            Category
            Status
            Source
            Language