conveyal/modeify

View on GitHub

Showing 301 of 580 total issues

Function rankRoutes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function rankRoutes (routes, primary, secondary) {
  var primaryDomain = [d3.min(routes, primary), d3.max(routes, primary)]
  var secondaryDomain = [d3.min(routes, secondary), d3.max(routes, secondary)]

  var primaryScale = d3.scale.linear()
Severity: Minor
Found in client/help-me-choose-view/index.js - About 1 hr to fix

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

    module.exports = function (ctx, next) {
      log('render')
    
      var cls = ctx.location.commuterLocations = ctx.commuterLocations
    
    
    Severity: Minor
    Found in client/commute-analysis-page/index.js - About 1 hr to fix

      Function handleSparkEvents has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports.handleSparkEvents = function handleSparkEvents (events, callback) {
        var batch = new Batch()
      
        events.forEach(function (evnt) {
          batch.push(function (done) {
      Severity: Minor
      Found in lib/email/process.js - About 1 hr to fix

        Function createRenderedEdge has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Network.prototype.createRenderedEdge = function(pathSegment, gEdge, forward, patterns) {
          var rEdge;
        
          // construct the edge key, disregarding mode qualifiers (e.g. "_RENT")
          var type = pathSegment.getType().split('_')[0];
        Severity: Minor
        Found in client/components/conveyal/transitive.js/master/lib/core/network.js - About 1 hr to fix

          Function rayIntersection has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          module.exports.rayIntersection = function(ax, ay, avx, avy, bx, by, bvx, bvy) {
          Severity: Major
          Found in client/components/conveyal/transitive.js/master/lib/util/index.js - About 1 hr to fix

            Function pointAlongArc has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            module.exports.pointAlongArc = function(x1, y1, x2, y2, r, theta, ccw, t) {
            Severity: Major
            Found in client/components/conveyal/transitive.js/master/lib/util/index.js - About 1 hr to fix

              Function lineIntersection has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              module.exports.lineIntersection = function(x1, y1, x2, y2, x3, y3, x4, y4) {
              Severity: Major
              Found in client/components/conveyal/transitive.js/master/lib/util/index.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                      if ((p) && (p[0] >= minX) && (p[0] < maxX) && (p[1] >= minY) && (p[
                        1] < maxY) && (p[2].parent) && (label.parent.patternIds === p[2]
                        .parent.patternIds)) {
                        matchItems.push(p[2]);
                      }

                  Function load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  session.load = function (ctx, next) {
                    session.settings(store('session') || DEFAULT_SETTINGS)
                  
                    loadUser(function (err) {
                      if (err) return next(err)
                  Severity: Minor
                  Found in client/session/index.js - About 55 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

                  Function coordAlongEdge has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Edge.prototype.coordAlongEdge = function(t, coords, display) {
                  
                    if (!this.baseRenderCoords) this.calculateBaseRenderCoords(display);
                  
                    if (coords.length === 2 && this.baseRenderCoords.length === 4) {
                  Severity: Minor
                  Found in client/components/conveyal/transitive.js/master/lib/graph/edge.js - About 55 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

                  Function DefaultRenderer has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var DefaultRenderer = augment(Renderer, function(base) {
                  
                    this.constructor = function(transitive) {
                      base.constructor.call(this, transitive);
                    };

                  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 renderRoute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Modal.prototype.renderRoute = function (data) {
                    data.calories = data.calories ? parseInt(data.calories, 10).toLocaleString() + ' cals' : 'None'
                    data.cost = data.cost ? '$' + data.cost.toFixed(2) : 'Free'
                    data.emissions = data.emissions ? parseInt(data.emissions, 10) : 'None'
                    data.walkDistance = data.walkDistance ? data.walkDistance + ' mi' : 'None'
                  Severity: Minor
                  Found in client/help-me-choose-view/index.js - About 55 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

                  Function decode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports.decode = function(polyline) {
                  
                    var currentPosition = 0;
                  
                    var currentLat = 0;
                  Severity: Minor
                  Found in client/components/conveyal/transitive.js/master/lib/util/polyline.js - About 55 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

                  Function mergeVertices has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  NetworkGraph.prototype.mergeVertices = function(vertexArray) {
                    var xTotal = 0,
                      yTotal = 0;
                  
                    var vertexGroups = {
                  Severity: Minor
                  Found in client/components/conveyal/transitive.js/master/lib/graph/index.js - About 55 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

                  Function page has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                    function page(path, fn) {
                      // <callback>
                      if ('function' === typeof path) {
                        return page('*', path);
                      }
                  Severity: Minor
                  Found in client/components/visionmedia/page.js/1.6.1/index.js - About 55 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

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

                  module.exports = function (schema, options) {
                    /**
                     * Add address and coordinate fields
                     */
                  
                  
                  Severity: Minor
                  Found in lib/plugins/mongoose-geocode.js - About 55 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

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

                  var View = module.exports = view(require('./template.html'), function (view, plan) {
                    plan.on('change', function (name) {
                      view.resetIcons()
                  
                      if (name === 'from') view.find('#from-location').value = plan.from()
                  Severity: Minor
                  Found in client/locations-view/index.js - About 55 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

                  Function getDomains has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function getDomains(display, height, width, bounds, options) {
                    var xmin = bounds[0][0],
                      xmax = bounds[1][0];
                    var ymin = bounds[0][1],
                      ymax = bounds[1][1];
                  Severity: Minor
                  Found in client/components/conveyal/transitive.js/master/lib/display/index.js - About 55 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

                  Avoid deeply nested control flow statements.
                  Open

                            if (el.type === 'date') {
                              val += '-' + date;
                            }
                  Severity: Major
                  Found in client/components/trevorgerhardt/serialize/0.0.1/index.js - About 45 mins to fix

                    Function angleFromThreePoints has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    module.exports.angleFromThreePoints = function(ax, ay, bx, by, cx, cy) {
                    Severity: Minor
                    Found in client/components/conveyal/transitive.js/master/lib/util/index.js - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language