merlos/panatrans-api

View on GitHub
public/examples/heatmap/heatmap.min.js

Summary

Maintainability
F
4 days
Test Coverage

Function j has 227 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var d = function j() {
        var a = function(a) {
            var b = a.gradient || a.defaultGradient;
            var c = document.createElement("canvas");
            var d = c.getContext("2d");
Severity: Major
Found in public/examples/heatmap/heatmap.min.js - About 1 day to fix

    File heatmap.min.js has 529 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * heatmap.js v2.0.0 | JavaScript Heatmap Library
     *
     * Copyright 2008-2014 Patrick Wied <heatmapjs@patrick-wied.at> - All rights reserved.
     * Dual licensed under MIT and Beerware license 
    Severity: Major
    Found in public/examples/heatmap/heatmap.min.js - About 1 day to fix

      Function i has 140 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var c = function i() {
              var a = function d(a) {
                  this._coordinator = {};
                  this._data = [];
                  this._radi = [];
      Severity: Major
      Found in public/examples/heatmap/heatmap.min.js - About 5 hrs to fix

        Function l has 108 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var g = function l() {
                var a = function h() {
                    function a() {
                        this.cStore = {}
                    }
        Severity: Major
        Found in public/examples/heatmap/heatmap.min.js - About 4 hrs to fix

          Function _colorize has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      _colorize: function() {
                          var a = this._renderBoundaries[0];
                          var b = this._renderBoundaries[1];
                          var c = this._renderBoundaries[2] - a;
                          var d = this._renderBoundaries[3] - b;
          Severity: Major
          Found in public/examples/heatmap/heatmap.min.js - About 2 hrs to fix

            Function _drawAlpha has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        _drawAlpha: function(a) {
                            var c = this._min = a.min;
                            var d = this._max = a.max;
                            var a = a.data || [];
                            var e = a.length;
            Severity: Minor
            Found in public/examples/heatmap/heatmap.min.js - About 1 hr to fix

              Function _organiseData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          _organiseData: function(a, b) {
                              var d = a[this._xField];
                              var e = a[this._yField];
                              var f = this._radi;
                              var g = this._data;
              Severity: Minor
              Found in public/examples/heatmap/heatmap.min.js - About 1 hr to fix

                Function c has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        var c = function(a) {
                            var b = [];
                            var c = a.min;
                            var d = a.max;
                            var e = a.radi;
                Severity: Minor
                Found in public/examples/heatmap/heatmap.min.js - About 1 hr to fix

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

                              setDataMax: function(a) {
                                  this._max = a;
                                  this._onExtremaChange();
                                  this._coordinator.emit("renderall", this._getInternalData());
                                  return this
                  Severity: Major
                  Found in public/examples/heatmap/heatmap.min.js and 1 other location - About 1 hr to fix
                  public/examples/heatmap/heatmap.min.js on lines 146..151

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

                  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

                              setDataMin: function(a) {
                                  this._min = a;
                                  this._onExtremaChange();
                                  this._coordinator.emit("renderall", this._getInternalData());
                                  return this
                  Severity: Major
                  Found in public/examples/heatmap/heatmap.min.js and 1 other location - About 1 hr to fix
                  public/examples/heatmap/heatmap.min.js on lines 140..145

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

                  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 (m + 2 * j > this._renderBoundaries[3]) {
                                          this._renderBoundaries[3] = m + 2 * j
                                      }
                  Severity: Minor
                  Found in public/examples/heatmap/heatmap.min.js and 1 other location - About 45 mins to fix
                  public/examples/heatmap/heatmap.min.js on lines 319..321

                  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 (l + 2 * j > this._renderBoundaries[2]) {
                                          this._renderBoundaries[2] = l + 2 * j
                                      }
                  Severity: Minor
                  Found in public/examples/heatmap/heatmap.min.js and 1 other location - About 45 mins to fix
                  public/examples/heatmap/heatmap.min.js on lines 322..324

                  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

                  There are no issues that match your filters.

                  Category
                  Status