conveyal/modeify

View on GitHub

Showing 301 of 580 total issues

Function refreshRenderData has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

RenderedEdge.prototype.refreshRenderData = function(display) {
  if (this.graphEdge.fromVertex.x === this.graphEdge.toVertex.x &&
    this.graphEdge.fromVertex.y === this.graphEdge.toVertex.y) {
    this.renderData = [];
    return;

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

Reactive.prototype.bindInterpolation = function(el, els){

  // element
  if (el.nodeType == 1) {
    for (var i = 0; i < el.attributes.length; i++) {
Severity: Minor
Found in client/components/ianstormtaylor/reactive/0.13.2/lib/index.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 createInternalVertexPoints has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

Network.prototype.createInternalVertexPoints = function() {

  this.internalVertexPoints = [];

  for (var i in this.graph.edgeGroups) {
Severity: Minor
Found in client/components/conveyal/transitive.js/master/lib/core/network.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 exports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function ({
  from,
  options,
  patterns,
  routes,
Severity: Minor
Found in lib/plan/profile-to-transitive.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 calculateWorldLengthAndMidpoint has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Edge.prototype.calculateWorldLengthAndMidpoint = function() {
  var allPoints = [this.fromVertex.point].concat(this.pointArray, [this.toVertex
    .point
  ]);
  this.worldLength = 0;
Severity: Minor
Found in client/components/conveyal/transitive.js/master/lib/graph/edge.js - About 1 hr to fix

    Function WireframeEdge has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var WireframeEdge = augment(Object, function() {
    
      this.constructor = function(edge) {
        this.edge = edge;
      };

      Function coordAlongEdge has 31 lines of code (exceeds 25 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 1 hr to fix

        Function get has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function get() {
            var req = Model.request
              .get(Model.url(''))
              .set(Model._headers);
        
        
        Severity: Minor
        Found in client/components/trevorgerhardt/model-query/0.3.0/index.js - About 1 hr to fix

          Function addCommuters has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          schema.statics.addCommuters = function (commuters) {
            later(() => {
              const commutersPerBatch = 1
              const delay = 250
              log.info(`adding ${commuters.length} commuters`)
          Severity: Minor
          Found in lib/commuter-locations/model.js - About 1 hr to fix

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

            module.exports = function (ctx, next) {
              log('attach view')
            
              // create lookup table mapping location IDs -> names
              ctx.organization.locations = ctx.locations
            Severity: Minor
            Found in client/organization-page/index.js - About 1 hr to fix

              Function processBikeRentalSegment has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Profiler.prototype.processBikeRentalSegment = function(edges, from, to) {
                var self = this;
              
                var preWalkEdges = [], bikeRentalEdges = [], postWalkEdges = [];
                var currentLeg = preWalkEdges;
              Severity: Minor
              Found in client/components/conveyal/otp-profiler/master/index.js - About 1 hr to fix

                Function Request has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Request(method, url) {
                  var self = this;
                  Emitter.call(this);
                  this._query = this._query || [];
                  this.method = method;
                Severity: Minor
                Found in client/components/visionmedia/superagent/v1.1.0/lib/client.js - About 1 hr to fix

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

                  module.exports = function (ctx, next) {
                    debug('render')
                    if (ctx.params.commuter === 'new' || !ctx.commuter) return
                  
                    CommuterLocation.forCommuter(ctx.commuter.get('_id'), function (err, commuterLocations) {
                  Severity: Minor
                  Found in client/commuter-page/index.js - About 1 hr to fix

                    Function populate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function populate(els, data) {
                      for (var i = 0, el; el = els[i]; i++) {
                        var val = data[el.getAttribute('name')];
                        if (val !== undefined) {
                    
                    
                    Severity: Minor
                    Found in client/components/trevorgerhardt/serialize/0.0.1/index.js - About 1 hr to fix

                      Function WireframeVertex has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var WireframeVertex = augment(Point, function(base) {
                      
                        this.constructor = function(vertex) {
                          base.constructor.call(this, {
                            vertex: vertex

                        Function loadCommuter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function loadCommuter (next) {
                          var commuterData = store('commuter')
                          var user = session.user()
                        
                          if (session.commuter()) {
                        Severity: Minor
                        Found in client/session/index.js - About 1 hr to fix

                          Function keydownInput has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          LocationSuggest.prototype.keydownInput = function (e) {
                            var el = e.target
                            var inputGroup = e.target.parentNode
                            var key = e.keyCode
                          
                          
                          Severity: Minor
                          Found in client/location-suggest/index.js - About 1 hr to fix

                            Function processBikeRentalSegment has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function processBikeRentalSegment (streetEdgeMap, edges, from, to) {
                              const preWalkEdges = []
                              const bikeRentalEdges = []
                              const postWalkEdges = []
                              let currentLeg = preWalkEdges
                            Severity: Minor
                            Found in lib/plan/profile-to-transitive.js - About 1 hr to fix

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

                              module.exports = function (reactive) {
                                reactive.bind('select-options', function (el, name, model) {
                                  this.change(function () {
                                    var options = this.value(name)
                                    var list = ''
                              Severity: Minor
                              Found in client/reactive-select/index.js - About 1 hr to fix

                                Function serialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function serialize(els) {
                                  var data = {};
                                  for (var i = 0, el; el = els[i]; i++) {
                                    var name = el.getAttribute('name');
                                    if (!data[name]) {
                                Severity: Minor
                                Found in client/components/trevorgerhardt/serialize/0.0.1/index.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language