conveyal/modeify

View on GitHub

Showing 580 of 580 total issues

File fore.js has 5496 lines of code (exceeds 250 allowed). Consider refactoring.
Open


module.exports = [
  "Aaron"
, "Aaron"
, "Abbey"
Severity: Major
Found in client/components/trevorgerhardt/names/0.0.2/lib/fore.js - About 2 wks to fix

    Function Labeler has 300 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Labeler = augment(Object, function() {
    
      this.constructor = function(transitive) {
    
        this.transitive = transitive;
    Severity: Major
    Found in client/components/conveyal/transitive.js/master/lib/labeler/index.js - About 1 day to fix

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

      Edge.prototype.adjustToAngle = function() {
        var ccw = Util.ccw(this.fx, this.fy, (this.fx + this.fvx), (this.fy + this.fvy),
          this.tx, this.ty);
        var delta = (ccw > 0) ? this.angleConstraintR : -this.angleConstraintR;
        var i = 0,
      client/components/conveyal/transitive.js/master/lib/graph/edge.js on lines 258..275

      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 271.

      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

      Edge.prototype.adjustFromAngle = function() {
        var ccw = Util.ccw(this.tx, this.ty, (this.tx + this.tvx), (this.ty + this.tvy),
          this.fx, this.fy);
        var delta = (ccw > 0) ? this.angleConstraintR : -this.angleConstraintR;
        var i = 0,
      client/components/conveyal/transitive.js/master/lib/graph/edge.js on lines 234..251

      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 271.

      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

        if (usableDisplayAspect > graphAspect) { // y-axis is limiting
          padding = paddingFactor * yRange;
          dispY1 = ymin - padding;
          dispY2 = ymax + padding;
          dispYRange = yRange + 2 * padding;
      client/components/conveyal/transitive.js/master/lib/display/index.js on lines 323..339

      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 252.

      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

        } else { // x-axis limiting
          padding = paddingFactor * xRange;
          dispX1 = xmin - padding;
          dispX2 = xmax + padding;
          dispXRange = xRange + 2 * padding;
      client/components/conveyal/transitive.js/master/lib/display/index.js on lines 308..323

      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 252.

      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

      File edge.js has 550 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var each = require('each');
      var PriorityQueue = require('priorityqueuejs');
      
      var Util = require('../util');
      
      
      Severity: Major
      Found in client/components/conveyal/transitive.js/master/lib/graph/edge.js - About 1 day to fix

        Function MultiPoint has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
        Open

        var MultiPoint = augment(Point, function(base) {
        
          this.constructor = function(pointArray) {
            base.constructor.call(this);
            this.points = [];

        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 Point has 198 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var Point = augment(Object, function() {
        
          this.constructor = function(data) {
            for (var key in data) {
              this[key] = data[key];
        Severity: Major
        Found in client/components/conveyal/transitive.js/master/lib/point/index.js - About 7 hrs to fix

          Function DefaultRenderer has 190 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function Stop has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
            Open

            var Stop = augment(Point, function(base) {
            
              this.constructor = function(data) {
                base.constructor.call(this, data);
            
            
            Severity: Minor
            Found in client/components/conveyal/transitive.js/master/lib/point/stop.js - About 7 hrs 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

            File index.js has 480 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            var d3 = require('d3');
            var debug = require('debug')('transitive:graph');
            var each = require('each');
            var clone = require('clone');
            var PriorityQueue = require('priorityqueuejs');
            Severity: Minor
            Found in client/components/conveyal/transitive.js/master/lib/graph/index.js - About 7 hrs to fix

              Function convertOtpData has 180 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Profiler.prototype.convertOtpData = function(opts) {
                var self = this;
                self.data = {
                  journeys: [],
                  patterns: [],
              Severity: Major
              Found in client/components/conveyal/otp-profiler/master/index.js - About 7 hrs to fix

                Function PointLabel has 176 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function getRenderCoords has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Edge.prototype.getRenderCoords = function(fromOffsetPx, toOffsetPx, display, forward) {
                    var fromOffsetX, fromOffsetY;
                    var isBase = (fromOffsetPx === 0 && toOffsetPx === 0);
                  
                    if (!this.baseRenderCoords && !isBase) {
                  Severity: Minor
                  Found in client/components/conveyal/transitive.js/master/lib/graph/edge.js - About 6 hrs 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 PointLabel has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                  Open

                  var PointLabel = augment(Label, function(base) {
                  
                    this.constructor = function(parent) {
                  
                      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

                  File index.js has 453 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  var Batch = require('batch');
                  var clone, each;
                  var superagent = require('superagent');
                  
                  try {
                  Severity: Minor
                  Found in client/components/conveyal/otp-profiler/master/index.js - About 6 hrs to fix

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

                    RenderedEdge.prototype.computeLineWidth = function(display, includeEnvelope) {
                      var styler = display.styler;
                      if (styler && display) {
                        // compute the line width
                        var env = styler.compute(styler.segments.envelope, display, this);
                    client/components/conveyal/transitive.js/master/lib/renderer/renderedsegment.js on lines 124..136

                    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 169.

                    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

                    RenderedSegment.prototype.computeLineWidth = function(display, includeEnvelope) {
                      var styler = display.styler;
                      if (styler && display) {
                        // compute the line width
                        var env = styler.compute(styler.segments.envelope, display, this);
                    client/components/conveyal/transitive.js/master/lib/renderer/renderededge.js on lines 162..174

                    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 169.

                    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 MultiPoint has 160 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var MultiPoint = augment(Point, function(base) {
                    
                      this.constructor = function(pointArray) {
                        base.constructor.call(this);
                        this.points = [];
                      Severity
                      Category
                      Status
                      Source
                      Language