lancew/DojoList

View on GitHub

Showing 1,940 of 1,940 total issues

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

function debug($var, $output_as_html = true)
{ 
  if ( is_null($var) ) { return '<span class="null-value">[NULL]</span>'; };
  $out = '';
  switch ($var) 
Severity: Minor
Found in lib/limonade.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

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

            if (!this.layers['markers']) {
                this.layers['markers'] = new OpenLayers.Layer.Markers('markers');
                map.addLayer(this.layers['markers']);
            }
Severity: Minor
Found in js/mapstraction.js and 1 other location - About 45 mins to fix
js/mapstraction.js on lines 1956..1959

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

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.layers['polylines']) {
                this.layers['polylines'] = new OpenLayers.Layer.Vector('polylines');
                map.addLayer(this.layers['polylines']);
            }
Severity: Minor
Found in js/mapstraction.js and 1 other location - About 45 mins to fix
js/mapstraction.js on lines 1612..1615

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

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

            for (var i = map.controls.length; i>1; i--) {
                map.controls[i-1].deactivate();
                map.removeControl(map.controls[i-1]);
            }
Severity: Minor
Found in js/mapstraction.js and 1 other location - About 40 mins to fix
js/mapstraction.js on lines 1161..1164

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

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

            for (var i = map.controls.length; i>3; i--) {
                map.controls[i-1].deactivate();
                map.removeControl(map.controls[i-1]);
            }
Severity: Minor
Found in js/mapstraction.js and 1 other location - About 40 mins to fix
js/mapstraction.js on lines 1132..1135

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

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

Form.EventObserver = Class.create(Abstract.EventObserver, {
  getValue: function() {
    return Form.serialize(this.element);
  }
});
Severity: Minor
Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 40 mins to fix
js/prototype/prototype-1.6.0.3.js on lines 3727..3731

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

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

Form.Observer = Class.create(Abstract.TimedObserver, {
  getValue: function() {
    return Form.serialize(this.element);
  }
});
Severity: Minor
Found in js/prototype/prototype-1.6.0.3.js and 1 other location - About 40 mins to fix
js/prototype/prototype-1.6.0.3.js on lines 3780..3784

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

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(
            window.BoundingBox ||
            window.LatLonPoint ||
            window.Mapstraction ||
            window.Marker ||
Severity: Major
Found in js/mapstraction.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if (Object.isString(insertions) || Object.isNumber(insertions) ||
            Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
              insertions = {bottom:insertions};
    Severity: Major
    Found in js/prototype/prototype-1.6.0.3.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

            if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
                (classNames && classNames.all(function(name) {
                  return !name.toString().blank() && cn.include(' ' + name + ' ');
                }))))
              elements.push(Element.extend(child));
      Severity: Major
      Found in js/prototype/prototype-1.6.0.3.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if (this.closed    || this.points[0].equals(this.points[length-1])) {
                var vmpoly = new VMPolygonShape(vmpoints, this.color, this.width || 5, this.fillColor, this.opacity || 0.2);
            }
            else {
                var vmpoly = new VMPolyLine(vmpoints, this.color, this.width || 5, this.opacity || 0.5);
        Severity: Major
        Found in js/mapstraction.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

              if (this.closed    || this.points[0].equals(this.points[length-1])) {
                  m24poly = new Map24.Polygon({
                      Longitudes: m24longs,
                      Latitudes: m24lats,
                      FillColor: [this.color || "grey", this.opacity || "0.5"],
          Severity: Major
          Found in js/mapstraction.js - About 40 mins to fix

            Classes should not have a constructor method with the same name as the class
            Open

                function AllTests()
                {
                    $this->TestSuite('All tests');
                    $this->addFile('tests/dojo_test.php');
                    $this->addFile('tests/data_test.php');
            Severity: Minor
            Found in tests-old/all_tests.php by phpmd

            ConstructorWithNameAsEnclosingClass

            Since: 0.2

            A constructor method should not have the same name as the enclosing class, consider to use the PHP 5 __construct method.

            Example

            class MyClass {
                 // this is bad because it is PHP 4 style
                public function MyClass() {}
                // this is good because it is a PHP 5 constructor
                public function __construct() {}
            }

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

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

            Mapstraction.prototype.addMarkerWithData = function(marker, data) {
                marker.addData(data);
                this.addMarker(marker);
            };
            Severity: Minor
            Found in js/mapstraction.js and 1 other location - About 40 mins to fix
            js/mapstraction.js on lines 1729..1732

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

            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

            Mapstraction.prototype.addPolylineWithData = function(polyline, data) {
                polyline.addData(data);
                this.addPolyline(polyline);
            };
            Severity: Minor
            Found in js/mapstraction.js and 1 other location - About 40 mins to fix
            js/mapstraction.js on lines 1719..1722

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

            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 pseudo has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                pseudo: function(nodes, name, value, root, combinator) {
            Severity: Minor
            Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

              Function addTileLayer has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              Mapstraction.prototype.addTileLayer = function(tile_url, opacity, copyright_text, min_zoom, max_zoom) {
              Severity: Minor
              Found in js/mapstraction.js - About 35 mins to fix

                Function nth has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    nth: function(nodes, formula, root, reverse, ofType) {
                Severity: Minor
                Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix

                  Method recaptcha_check_answer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function recaptcha_check_answer($privkey, $remoteip, $challenge, $response, $extra_params = array())
                  Severity: Minor
                  Found in lib/recaptchalib.php - About 35 mins to fix

                    Method test_request has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function test_request($url, $method="GET", $include_header=false, $post_data=array(), $http_header=array()) {
                    Severity: Minor
                    Found in lib/limonade/tests.php - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language