conveyal/modeify

View on GitHub

Showing 301 of 580 total issues

Function getRenderCoords has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Edge.prototype.getRenderCoords = function(fromOffsetPx, toOffsetPx, display, forward) {
  var fromOffsetX, fromOffsetY;
  var isBase = (fromOffsetPx === 0 && toOffsetPx === 0);

  if (!this.baseRenderCoords && !isBase) {
Severity: Major
Found in client/components/conveyal/transitive.js/master/lib/graph/edge.js - About 4 hrs to fix

    Function Place has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Place = augment(Point, function(base) {
    
      /**
       *  the constructor
       */
    Severity: Major
    Found in client/components/conveyal/transitive.js/master/lib/point/place.js - About 4 hrs to fix

      Function Stats has 103 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Stats = function () {
        var startTime = Date.now()
        var prevTime = startTime
        var ms = 0
        var msMin = Infinity
      Severity: Major
      Found in client/stats/stats.js - About 4 hrs to fix

        Function exports has 103 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function (schema, options) {
          /**
           * Add address and coordinate fields
           */
        
        
        Severity: Major
        Found in lib/plugins/mongoose-geocode.js - About 4 hrs to fix

          Function setAddress has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Plan.prototype.setAddress = function (name, locationData, callback) {
            callback = callback || function () {} // noop callback
            if (
              !locationData &&
              (
          Severity: Major
          Found in client/plan/index.js - About 4 hrs to fix

            Function apply2DOffsets has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            NetworkGraph.prototype.apply2DOffsets = function() {
            
              this.initComparisons();
            
              var alignmentBundles = {}; // maps alignment ID to array of range-bounded bundles on that alignment
            Severity: Minor
            Found in client/components/conveyal/transitive.js/master/lib/graph/index.js - About 3 hrs 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 updateRoutes has 95 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function updateRoutes (plan, opts, callback) {
              opts = opts || {}
            
              const done = function (err, res) {
                if (err) {
            Severity: Major
            Found in client/plan/update-routes.js - About 3 hrs to fix

              Function View has 94 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              var View = view(require('./template.html'), function (view, model) {
                var scorer = new ProfileScorer()
              
                view.on('rendered', function () {
                  try {
              Severity: Major
              Found in client/commute-analysis-page/index.js - About 3 hrs to fix

                Function end has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                Request.prototype.end = function(fn){
                  var self = this;
                  var xhr = this.xhr = request.getXHR();
                  var query = this._query.join('&');
                  var timeout = this._timeout;
                Severity: Minor
                Found in client/components/visionmedia/superagent/v1.1.0/lib/client.js - About 3 hrs 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

                File index.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                var convert = require('../convert')
                var model = require('component-model')
                var defaults = require('../components/segmentio/model-defaults/0.2.0')
                var each = require('component-each')
                
                
                Severity: Minor
                Found in client/route/index.js - About 3 hrs to fix

                  Function load has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Network.prototype.load = function(data) {
                    debug('loading', data);
                    var self = this;
                  
                    // check data
                  Severity: Major
                  Found in client/components/conveyal/transitive.js/master/lib/core/network.js - About 3 hrs to fix

                    Function Point has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var Point = augment(Object, function() {
                    
                      this.constructor = function(data) {
                        for (var key in data) {
                          this[key] = data[key];
                    Severity: Minor
                    Found in client/components/conveyal/transitive.js/master/lib/point/index.js - About 3 hrs 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

                    File index.js has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /**
                     * Dependencies
                     */
                    
                    var augment = require('augment');
                    Severity: Minor
                    Found in client/components/conveyal/transitive.js/master/lib/labeler/index.js - About 3 hrs to fix

                      Function journeys has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const journeys = options.reduce(function (journeys, option, optionIndex) {
                          // handle non-transit option as a special case
                          if (!option.transit) {
                            // create separate journey for each non-transit mode contained in this option
                            return journeys.concat(option.access.map(function (leg) {
                      Severity: Major
                      Found in lib/plan/profile-to-transitive.js - About 3 hrs to fix

                        File profile-to-transitive.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /**
                         * Convert OTP data into a consumable format
                         *
                         * @param {Object} options
                         * @return {Object} data
                        Severity: Minor
                        Found in lib/plan/profile-to-transitive.js - About 3 hrs to fix

                          Function exports has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function(reactive){
                          
                            /**
                             * Generate attribute bindings.
                             */
                          Severity: Major
                          Found in client/components/ianstormtaylor/reactive/0.13.2/lib/bindings.js - About 3 hrs to fix

                            Function SegmentLabel has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            var SegmentLabel = augment(Label, function(base) {
                            
                              this.constructor = function(parent, text) {
                            
                                base.constructor.call(this, parent);

                              Function exports has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                              module.exports = function(points) {
                                var newPoints, i, r;
                              
                                // determine if we need to resample the path (i.e. place new points at a regular
                                // interval for marker-based styling) based on styler settings

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

                                this.addSegmentsToQuadtree = function() {
                              
                                  var disp = this.transitive.display;
                                  this.transitive.renderSegments.forEach(function(segment) {
                              
                              
                              Severity: Major
                              Found in client/components/conveyal/transitive.js/master/lib/labeler/index.js - About 2 hrs to fix

                                Function apply2DOffsets has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                NetworkGraph.prototype.apply2DOffsets = function() {
                                
                                  this.initComparisons();
                                
                                  var alignmentBundles = {}; // maps alignment ID to array of range-bounded bundles on that alignment
                                Severity: Major
                                Found in client/components/conveyal/transitive.js/master/lib/graph/index.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language