conveyal/modeify

View on GitHub

Showing 580 of 580 total issues

Avoid too many return statements within this function.
Open

    try { return new ActiveXObject('Msxml2.XMLHTTP'); } catch(e) {}
Severity: Major
Found in client/components/visionmedia/superagent/v1.1.0/lib/client.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        if (el.getAttribute('download') || el.getAttribute('rel') === 'external') return;
    Severity: Major
    Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          if (base && orig === path) return;
      Severity: Major
      Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            if (el.target) return;
        Severity: Major
        Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              if (!sameOrigin(el.href)) return;
          Severity: Major
          Found in client/components/visionmedia/page.js/1.6.1/index.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return true
            Severity: Major
            Found in lib/plan/profile-filter.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return true
              Severity: Major
              Found in lib/plan/profile-filter.js - About 30 mins to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                          y: allPoints[i].worldY + t * (allPoints[i + 1].worldY - allPoints[i].worldY)
                client/components/conveyal/transitive.js/master/lib/graph/edge.js on lines 81..81

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                Route.prototype.vmtRate = function () {
                  return this.plan().scorer().rates.mileageRate
                }
                Severity: Minor
                Found in client/route/index.js and 2 other locations - About 30 mins to fix
                client/route/index.js on lines 354..356
                client/route/index.js on lines 362..364

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                transitive.on('place.from.dragend', function (place) {
                  placeChanged('from', {
                    lat: place.place_lat,
                    lng: place.place_lon
                  })
                Severity: Minor
                Found in client/transitive/index.js and 1 other location - About 30 mins to fix
                client/transitive/index.js on lines 32..37

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                Route.prototype.weight = function () {
                  return this.plan().scorer().rates.weight
                }
                Severity: Minor
                Found in client/route/index.js and 2 other locations - About 30 mins to fix
                client/route/index.js on lines 354..356
                client/route/index.js on lines 358..360

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                          x: allPoints[i].worldX + t * (allPoints[i + 1].worldX - allPoints[i].worldX),
                client/components/conveyal/transitive.js/master/lib/graph/edge.js on lines 82..82

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    commuters.forEach(function (commuter) {
                      batch.push(function (done) {
                        commuter.updateStatus(done)
                      })
                    })
                Severity: Minor
                Found in lib/commuter/process.js and 1 other location - About 30 mins to fix
                lib/email/process.js on lines 44..48

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                Route.prototype.walkSpeed = function () {
                  return this.plan().scorer().rates.walkSpeed
                }
                Severity: Minor
                Found in client/route/index.js and 2 other locations - About 30 mins to fix
                client/route/index.js on lines 358..360
                client/route/index.js on lines 362..364

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                transitive.on('place.to.dragend', function (place) {
                  placeChanged('to', {
                    lat: place.place_lat,
                    lng: place.place_lon
                  })
                Severity: Minor
                Found in client/transitive/index.js and 1 other location - About 30 mins to fix
                client/transitive/index.js on lines 25..30

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    emails.forEach(function (email) {
                      batch.push(function (done) {
                        email.syncWithSpark(done)
                      })
                    })
                Severity: Minor
                Found in lib/email/process.js and 1 other location - About 30 mins to fix
                lib/commuter/process.js on lines 12..16

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 45.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Function loadCommuter has a Cognitive Complexity of 6 (exceeds 5 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 25 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 loadOrg has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                Ridepool.loadOrg = function (ctx, next) {
                  log.info('ridepool loadOrg')
                  request
                    .get('/ridepools/created_by/' + ctx.params.organization, function (err, res) {
                      if (err) {
                Severity: Minor
                Found in client/ridepool/index.js - About 25 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 modesCSV has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                Plan.prototype.modesCSV = function () {
                  var modes = []
                  if (this.bike()) modes.push('BICYCLE')
                  if (this.bikeShare()) modes.push('BICYCLE_RENT')
                  if (this.bus()) modes.push('BUS')
                Severity: Minor
                Found in client/plan/index.js - About 25 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 offsetAlignment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                RenderedEdge.prototype.offsetAlignment = function(alignmentId, offset) {
                
                  if (this.graphEdge.getFromAlignmentId() === alignmentId) {
                    this.setFromOffset(Util.isOutwardVector(this.graphEdge.fromVector) ? offset :
                      -offset);

                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