merlos/panatrans-api

View on GitHub

Showing 19 of 19 total issues

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

            Method dump_json has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

              def self.dump_json(opts = {})
            
                @output_dir = opts[:output_dir] || './tmp'
                @api_version = opts[:api_version] || 'v1'
            
            
            Severity: Minor
            Found in lib/tasks/dataset_helper.rb - 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

            Method dump_json has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def self.dump_json(opts = {})
            
                @output_dir = opts[:output_dir] || './tmp'
                @api_version = opts[:api_version] || 'v1'
            
            
            Severity: Minor
            Found in lib/tasks/dataset_helper.rb - About 1 hr to fix

              Function _update has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _update: function() {
                  var bounds, zoom, scale;
              
                  bounds = this._map.getBounds();
                  zoom = this._map.getZoom();
              Severity: Minor
              Found in public/examples/heatmap/leaflet-heatmap.min.js - About 1 hr to fix

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

                  _update: function() {
                    var bounds, zoom, scale;
                
                    bounds = this._map.getBounds();
                    zoom = this._map.getZoom();
                Severity: Minor
                Found in public/examples/heatmap/leaflet-heatmap.min.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 _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

                    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

                    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

                                          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

                      Function addData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        addData: function(pointOrArray) {
                          if (pointOrArray.length > 0) {
                            var len = pointOrArray.length;
                            while(len--) {
                              this.addData(pointOrArray[len]);
                      Severity: Minor
                      Found in public/examples/heatmap/leaflet-heatmap.min.js - About 35 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

                      Method import has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def self.import(csv_dir = '')
                          csv_dir = self.default_csv_dir.to_s if csv_dir === ''
                          puts "   Importing data from: " + csv_dir
                          Rails.application.eager_load!
                          ActiveRecord::Base.transaction do
                      Severity: Minor
                      Found in lib/tasks/dataset_helper.rb - About 35 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

                      Method update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def update
                            # BUG of act_as_list
                            # if an element is not in list and added to the list => there is a weird behaviour with the
                            # first position
                            # current element in position 0, keeps the same position.
                      Severity: Minor
                      Found in app/controllers/v1/stop_sequences_controller.rb - About 25 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

                      Severity
                      Category
                      Status
                      Source
                      Language