conveyal/modeify

View on GitHub

Showing 301 of 580 total issues

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

  this.render = function(display) {
    this.svgGroup = this.parent.labelSvg.append('g')
      .attr('class', 'transitive-sortable')
      .datum({
        owner: this,

    Function decode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports.decode = function(polyline) {
    
      var currentPosition = 0;
    
      var currentLat = 0;

      Function upload has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Modal.prototype.upload = function (e) {
        e.preventDefault()
        var modal = this
        var location = this.model.location
      
      
      Severity: Minor
      Found in client/location-page/commuter-confirm-modal.js - About 1 hr to fix

        Function onsubmit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            closest(view.el, 'form').onsubmit = function (e) {
              e.preventDefault()
        
              // only reset addresses if needed
              const newFromValue = view.find('.from input').value
        Severity: Minor
        Found in client/locations-view/index.js - About 1 hr to fix

          Function remove has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          LocationRow.prototype.remove = function () {
            var self = this
            CommuterLocation.forLocation(self.model._id(), function (err, cls) {
              if (err) console.error(err)
              Ridepool.forLocation(self.model._id(), function (err, ridepools) {
          Severity: Minor
          Found in client/organization-page/view.js - About 1 hr to fix

            Function annotateTransitPoints has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Network.prototype.annotateTransitPoints = function() {
              var lookup = {};
            
              this.paths.forEach(function(path) {
            
            
            Severity: Minor
            Found in client/components/conveyal/transitive.js/master/lib/core/network.js - About 1 hr to fix

              Function request has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              const request = module.exports.request = function request (url) {
                return new Promise((resolve, reject) => {
                  const options = {
                    host: otp.host,
                    method: 'GET',
              Severity: Minor
              Found in lib/otp/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 keydownInput has a Cognitive Complexity of 10 (exceeds 5 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

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

                page.start = function(options) {
                  options = options || {};
                  if (running) return;
                  running = true;
                  if (false === options.dispatch) dispatch = false;
              Severity: Minor
              Found in client/components/visionmedia/page.js/1.6.1/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 SegmentLabel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

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

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

              function getMargins(options) {
                var margins = {
                  left: 0,
                  right: 0,
                  top: 0,

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

              module.exports.send = function send (options, callback, template) {
                if (process.env.NODE_ENV === 'test') {
                  if (options.to.email && options.template) {
                    return callback(null, {
                      _id: '123',
              Severity: Minor
              Found in lib/spark.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 Context has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                function Context(path, state) {
                  if ('/' === path[0] && 0 !== path.indexOf(base)) path = base + (hashbang ? '#!' : '') + path;
                  var i = path.indexOf('?');
              
                  this.canonicalPath = path;
              Severity: Minor
              Found in client/components/visionmedia/page.js/1.6.1/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 createRenderedSegments has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Network.prototype.createRenderedSegments = function() {
                this.reLookup = {};
                this.renderedEdges = [];
                this.renderedSegments = [];
              
              
              Severity: Minor
              Found in client/components/conveyal/transitive.js/master/lib/core/network.js - About 1 hr to fix

                Function creq has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    const creq = http.request(options, (cres) => {
                      cres.setEncoding('utf8')
                      cres.pipe(concat((data) => {
                        if (cres.statusCode !== 200) {
                          log.error('otp:error', {
                Severity: Minor
                Found in lib/otp/index.js - About 1 hr to fix

                  Function profile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const profile = optionsSplitByAccessAndEgressMode.map((option) => {
                      if (option.transit !== null && option.transit.length > 0) {
                        const legs = option.transit.length
                        const totalWaitingTime = option.itinerary[0].waitingTime
                        const totalTransitTime = option.itinerary[0].transitTime
                  Severity: Minor
                  Found in lib/plan/r5-to-otp.js - About 1 hr to fix

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

                    var View = view(require('./template.html'), function (view, model) {
                      var fromDateInput = view.find('.fromDate')
                    
                      var defaultToDate = moment()
                      var defaultFromDate = moment().add(-7, 'days')
                    Severity: Minor
                    Found in client/user-activity-page/index.js - About 1 hr to fix

                      Function drawGrid has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      module.exports = function drawGrid(display, cellSize) {
                        var svg = display.svg;
                        var xScale = display.xScale;
                        var yScale = display.yScale;
                      
                      

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

                        function narrativeDirections (edges) {
                          if (!edges) return ''
                        
                          return edges.map(function (se) {
                            if (!se.streetName && !se.bikeRentalOffStation) {
                        Severity: Minor
                        Found in client/route-directions-table/index.js - About 1 hr to fix

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

                            this.render = function(display) {
                              base.render.call(this, display);
                              if (!this.renderData) return;
                          
                              this.initSvg(display);
                          Severity: Minor
                          Found in client/components/conveyal/transitive.js/master/lib/point/place.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language