Showing 105 of 165 total issues
Function constructor
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(transitive) {
this.transitive = transitive
this.clusters = []
this.clusterLookup = {} // maps Point object to its containing cluster
Function refreshRenderData
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
refreshRenderData(display) {
if (
this.graphEdge.fromVertex.x === this.graphEdge.toVertex.x &&
this.graphEdge.fromVertex.y === this.graphEdge.toVertex.y
) {
Function calculateGeometry
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
calculateGeometry(cellSize, angleConstraint) {
// if(!this.hasTransit()) angleConstraint = 5;
angleConstraint = angleConstraint || 45
this.angleConstraintR = (angleConstraint * Math.PI) / 180
Function intersect
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
intersect(rEdge) {
// do no intersect adjacent edges of unequal bundle size
if (
this.graphEdge.renderedEdges.length !==
rEdge.graphEdge.renderedEdges.length
- Read upRead up
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 load
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
load(data) {
debug('loading', data)
// check data
if (!data) data = {}
- Read upRead up
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 getGeometricCoords
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
getGeometricCoords(fromOffsetPx, toOffsetPx, display, forward) {
const coords = []
// reverse the coords array if needed
const geomCoords = forward
Function mergeVertices
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
mergeVertices(vertexArray) {
let xTotal = 0
let yTotal = 0
const vertexGroups = {
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(display) {
const text = this.getText()
// Do not attempt to render label if there is no label text.
if (!text) return null
const x = this.labelAnchor.x - this.containerWidth / 2
Function computeDomainsFromBounds
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
computeDomainsFromBounds(bounds) {
const xmin = bounds[0][0]
const xmax = bounds[1][0]
const ymin = bounds[0][1]
const ymax = bounds[1][1]
Function intersect
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
intersect(rEdge) {
// do no intersect adjacent edges of unequal bundle size
if (
this.graphEdge.renderedEdges.length !==
rEdge.graphEdge.renderedEdges.length
Function placePointLabels
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
placePointLabels() {
const styler = this.transitive.styler
const placedLabels = []
// var labeledPoints = []
Function setOrientation
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
setOrientation(orientation) {
this.orientation = orientation
const markerBBox = this.parent.getMarkerBBox()
if (!markerBBox) return
Function placeSegmentLabels
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
placeSegmentLabels() {
this.placedLabelKeys = []
const placedLabels = []
// collect the bus RenderSegments
Function getModeStyles
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
getModeStyles(mode, display) {
const modeStyles = {}
// simulate a segment w/ the specified style
const segment = {
Function calculateWorldLengthAndMidpoint
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
calculateWorldLengthAndMidpoint() {
const allPoints = [this.fromVertex.point].concat(this.pointArray, [
this.toVertex.point
])
this.worldLength = 0
Function initComparisons
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
initComparisons() {
this.bundleComparisons = {}
forEach(this.vertices, (vertex) => {
const incidentGraphEdges = vertex.incidentEdges()
Function focusPath
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
focusPath(path) {
let pathRenderedSegments = []
const graph = this.transitive.network.graph
if (path) {
Function getModeStyles
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getModeStyles(mode, display) {
const modeStyles = {}
// simulate a segment w/ the specified style
const segment = {
- Read upRead up
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 createInternalVertexPoints
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
createInternalVertexPoints() {
this.internalVertexPoints = []
for (const i in this.graph.edgeGroups) {
const edgeGroup = this.graph.edgeGroups[i]
- Read upRead up
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 stroke
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function (display, segment) {
if (!segment.focused) return notFocusedColor
if (segment.type === 'TRANSIT') {
if (segment.patterns) {
if (patternIsDcCirculatorBusRoute(segment.patterns[0])) return '#f00'
- Read upRead up
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"