conveyal/modeify

View on GitHub

Showing 301 of 580 total issues

Function stroke has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    function(display, data) {
      var segment = data;
      if (!segment.focused) return notFocusedColor;
      if (segment.type === 'TRANSIT') {
        if (segment.patterns) {
Severity: Minor
Found in client/components/conveyal/transitive.js/master/lib/styler/styles.js - About 45 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 messages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function messages (ns, msgs) {
  msgs = msgs || DEFAULT_MESSAGES
  ns = ns ? ns.split(':') : []

  /**
Severity: Minor
Found in client/messages/index.js - About 45 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 calculateWorldLengthAndMidpoint has a Cognitive Complexity of 8 (exceeds 5 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 45 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 ccw has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

module.exports.ccw = function(ax, ay, bx, by, cx, cy) {
Severity: Minor
Found in client/components/conveyal/transitive.js/master/lib/util/index.js - About 45 mins to fix

    Function resampleArc has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function resampleArc(startPt, endPt, r, theta, ccw, spacing) {

      Function exports has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function() {
        var size = [960, 500],
          scale = 256,
          translate = [size[0] / 2, size[1] / 2],
          zoomDelta = 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

      Avoid deeply nested control flow statements.
      Open

              if (err) {
                return callback(err)
              } else {
                location.coordinate(res)
                changes[name] = locationData
      Severity: Major
      Found in client/plan/index.js - About 45 mins to fix

        Function ccwRaw has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        module.exports.ccwRaw = function(ax, ay, bx, by, cx, cy) {
        Severity: Minor
        Found in client/components/conveyal/transitive.js/master/lib/util/index.js - About 45 mins to fix

          Function bind has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          Reactive.prototype.bind = function(name, fn) {
            if ('object' == typeof name) {
              for (var key in name) {
                this.bind(key, name[key]);
              }
          Severity: Minor
          Found in client/components/ianstormtaylor/reactive/0.13.2/lib/index.js - About 45 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 Label has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          var Label = augment(Object, function() {
          
            this.constructor = function(parent) {
              this.parent = parent;
              this.sortableType = 'LABEL';
          Severity: Minor
          Found in client/components/conveyal/transitive.js/master/lib/labeler/label.js - About 45 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 dispatch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            page.dispatch = function(ctx) {
              var prev = prevContext,
                i = 0,
                j = 0;
          
          
          Severity: Minor
          Found in client/components/visionmedia/page.js/1.6.1/index.js - About 45 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

          Consider simplifying this complex logical expression.
          Open

                if ((p) && (p[0] >= minX) && (p[0] < maxX) && (p[1] >= minY) && (p[
                  1] < maxY) && label.intersects(p[2])) {
                  matchItems.push(p[2]);
                }
          Severity: Major
          Found in client/components/conveyal/transitive.js/master/lib/labeler/index.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                if (!called) {
                  called = true
                  debug('<-- %s > %s', name, err || res.error || res.status)
                  callback(err || res.error, res)
                } else {
            Severity: Major
            Found in client/request/index.js - About 40 mins to fix

              Function applyRules has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              Styler.prototype.applyRules = function(display, elements, name, rules, fn) {
              Severity: Minor
              Found in client/components/conveyal/transitive.js/master/lib/styler/index.js - About 35 mins to fix

                Function bbox has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  SphericalMercator.prototype.bbox = function(x, y, zoom, tms_style, srs) {

                  Function equalVectors has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function equalVectors(x1, y1, x2, y2, tol) {
                  Severity: Minor
                  Found in client/components/conveyal/transitive.js/master/lib/graph/edge.js - About 35 mins to fix

                    Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    module.exports = function haversine(lat1, lon1, lat2, lon2, miles) {
                    Severity: Minor
                    Found in client/components/trevorgerhardt/haversine/master/index.js - About 35 mins to fix

                      Function getDomains has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function getDomains(display, height, width, bounds, options) {
                      Severity: Minor
                      Found in client/components/conveyal/transitive.js/master/lib/display/index.js - About 35 mins to fix

                        Function createGraphEdge has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        Network.prototype.createGraphEdge = function(segment, fromVertex, toVertex, internalPoints, geomCoords) {
                        Severity: Minor
                        Found in client/components/conveyal/transitive.js/master/lib/core/network.js - About 35 mins to fix

                          Function constructJourneySegment has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function constructJourneySegment (streetEdgeMap, mode, from, to, edges) {
                          Severity: Minor
                          Found in lib/plan/profile-to-transitive.js - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language