merlos/panatrans-api

View on GitHub

Showing 15 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

                    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

                      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