conveyal/transitive.js

View on GitHub

Showing 165 of 165 total issues

Function addRenderData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  addRenderData(stopInfo) {
    if (stopInfo.rEdge.getType() === 'TRANSIT') {
      const s = {
        getZIndex: function () {
          if (this.owner.graphVertex) {
Severity: Minor
Found in lib/point/stop.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 createRenderedEdge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  createRenderedEdge(pathSegment, gEdge, forward, patterns) {
    let rEdge

    // construct the edge key, disregarding mode qualifiers (e.g. "_RENT")
    const type = pathSegment.getType().split('_')[0]
Severity: Minor
Found in lib/core/network.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 compute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  compute(rules, display, data, index) {
    let computed
    for (const i in rules) {
      const rule = rules[i]
      const val =
Severity: Minor
Found in lib/styler/styler.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 compute2 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  compute2(type, attr, data, index) {
    let computed
    const rules = this[type][attr]
    if (!rules) return null
    for (const rule of rules) {
Severity: Minor
Found in lib/styler/styler.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 drawPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  drawPath(renderData, attrs) {
    if (!renderData || renderData.length === 0) return

    // Apply stroke/width styles
    this.ctx.strokeStyle = attrs.stroke
Severity: Minor
Found in lib/display/canvas-display.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

Severity
Category
Status
Source
Language