conveyal/modeify

View on GitHub

Showing 301 of 580 total issues

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

NetworkGraph.prototype.sortVertices = function() {
  this.vertices.sort(function(a, b) {
    if (a.point && a.point.getType() === 'PLACE') return -1;
    if (b.point && b.point.getType() === 'PLACE') return 1;

Severity: Minor
Found in client/components/conveyal/transitive.js/master/lib/graph/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 tally has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

ProfileScore.prototype.tally = function (o) {
  // Defaults
  o.bikeCalories = 0
  o.calories = 0
  o.cost = 0
Severity: Minor
Found in client/components/conveyal/otp-profile-score/master/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 getXHR has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

request.getXHR = function () {
  if (root.XMLHttpRequest
    && ('file:' != root.location.protocol || !root.ActiveXObject)) {
    return new XMLHttpRequest;
  } else {
Severity: Minor
Found in client/components/visionmedia/superagent/v1.1.0/lib/client.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 12 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function(reactive){

  /**
   * Generate attribute bindings.
   */
Severity: Minor
Found in client/components/ianstormtaylor/reactive/0.13.2/lib/bindings.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 debug has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function debug(namespace) {

  // define the `disabled` version
  function disabled() {
  }
Severity: Minor
Found in client/components/visionmedia/debug/2.1.3/debug.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 getModeStyles has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Styler.prototype.getModeStyles = function(mode, display) {
  var modeStyles = {};

  // simulate a segment w/ the specified style
  var segment = {
Severity: Minor
Found in client/components/conveyal/transitive.js/master/lib/styler/index.js - About 1 hr to fix

    Function updateRange has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    View.prototype.updateRange = function () {
      var view = this
      var fromDate = moment(this.fromDatePicker.getDate())
      var toDate = moment(this.toDatePicker.getDate())
    
    
    Severity: Minor
    Found in client/user-activity-page/index.js - About 1 hr to fix

      Function render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        this.render = function() {
          base.render.call(this);
      
          var self = this;
          var display = this.transitive.display;

        Function initMarkerData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          this.initMarkerData = function(display) {
        
            if (this.getType() !== 'STOP' && this.getType() !== 'MULTI') return;
        
            this.mergedMarkerData = this.constructMergedMarker(display);
        Severity: Minor
        Found in client/components/conveyal/transitive.js/master/lib/point/index.js - About 1 hr to fix

          Function sendEmail has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          ShareModal.prototype.sendEmail = function () {
            var self = this
          
            var fromName = this.find('.from-name').value
            if (!fromName || fromName === '') {
          Severity: Minor
          Found in client/share-view/index.js - About 1 hr to fix

            Function iterateAndApply has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            schema.statics.iterateAndApply = function (fn, opts) {
              const tick = opts.tick || function () {}
              const limit = opts.limit || 100
              return new Promise((resolve, reject) => {
                let more = true
            Severity: Minor
            Found in lib/commuter/model.js - About 1 hr to fix

              Function toggleManager has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Row.prototype.toggleManager = function () {
                var org = this.model
                var manager = org.manager
                alerts.clear()
                if (this.isAdmin()) {
              Severity: Minor
              Found in client/manager-page/index.js - About 1 hr to fix

                Function Renderer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var Renderer = augment(Object, function() {
                
                  this.constructor = function(transitive) {
                    this.transitive = transitive;
                  };

                  Function render has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  RenderedSegment.prototype.render = function(display) {
                  
                    this.line = d3.svg.line() // the line translation function
                    .x(function(data, i) {
                      return data.x;

                    Function WireframeRenderer has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Function journey has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Profiler.prototype.journey = function(opts, callback) {
                        var batch = new Batch();
                        var profiler = this;
                      
                        // If a profile isn't passed, retrieve the profile
                      Severity: Minor
                      Found in client/components/conveyal/otp-profiler/master/index.js - About 1 hr to fix

                        Function next has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function next() {
                            var i = index++;
                            var fn = fns[i];
                            if (!fn) return;
                            var start = new Date;
                        Severity: Minor
                        Found in client/components/visionmedia/batch/0.5.2/index.js - About 1 hr to fix

                          Function enabled has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function enabled() {
                          
                              var self = enabled;
                          
                              // set `diff` timestamp
                          Severity: Minor
                          Found in client/components/visionmedia/debug/2.1.3/debug.js - About 1 hr to fix

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

                            NetworkGraph.prototype.bounds = function() {
                              var xmax = null,
                                xmin = null;
                              var ymax = null,
                                ymin = null;
                            Severity: Minor
                            Found in client/components/conveyal/transitive.js/master/lib/graph/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 refresh has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                            Modal.prototype.refresh = function (e) {
                              if (e) e.preventDefault()
                              log('refreshing')
                            
                              primaryFilter = this.primaryFilter.value
                            Severity: Minor
                            Found in client/help-me-choose-view/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

                            Severity
                            Category
                            Status
                            Source
                            Language