Showing 105 of 165 total issues
Function lineIntersection
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function lineIntersection(x1, y1, x2, y2, x3, y3, x4, y4) {
Function rayIntersection
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function rayIntersection(ax, ay, avx, avy, bx, by, bvx, bvy) {
Function componentDidUpdate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(prevProps) {
// Check if we received new transitive data
if (
this.transitive &&
!isEqual(prevProps.transitiveData, this.props.transitiveData)
- 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 mergeVertices
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
mergeVertices(vertexArray) {
let xTotal = 0
let yTotal = 0
const vertexGroups = {
- 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 setOrientation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
setOrientation(orientation) {
this.orientation = orientation
const markerBBox = this.parent.getMarkerBBox()
if (!markerBBox) return
- 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 computeDomainsFromBounds
has a Cognitive Complexity of 9 (exceeds 5 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]
- 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 decode
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function decode(polyline) {
let currentPosition = 0
let currentLat = 0
let currentLng = 0
- 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 calculateWorldLengthAndMidpoint
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
calculateWorldLengthAndMidpoint() {
const allPoints = [this.fromVertex.point].concat(this.pointArray, [
this.toVertex.point
])
this.worldLength = 0
- 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 ccw
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function ccw(ax, ay, bx, by, cx, cy) {
Function getBBox
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getBBox() {
if (this.orientation === 'E') {
return {
height: this.textHeight,
width: this.textWidth,
- 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 ccwRaw
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function ccwRaw(ax, ay, bx, by, cx, cy) {
Function angleFromThreePoints
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function angleFromThreePoints(ax, ay, bx, by, cx, cy) {
Function constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(options: TransitiveOptions) {
if (!(this instanceof Transitive)) return new Transitive(options)
this.options = options
if (this.options.zoomEnabled === undefined) this.options.zoomEnabled = true
- 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
Consider simplifying this complex logical expression. Open
if (!p1 || !p2 || !v1 || !v2 || (p1.x === p2.x && p1.y === p2.y)) return
Function equalVectors
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function equalVectors(x1, y1, x2, y2, tol) {
Function load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
load(styles) {
for (const i in types) {
const type = types[i]
if (styles[type]) {
for (const key in styles[type]) {
- 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 mergeEdges
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
mergeEdges(edge1, edge2) {
// check for infinite recursion loop case
if (
edge1.fromVertex === edge2.toVertex &&
edge2.fromVertex === edge1.toVertex
- 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 updateActiveZoomFactors
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
updateActiveZoomFactors(scale) {
let updated = false
for (let i = 0; i < this.zoomFactors.length; i++) {
const min = this.zoomFactors[i].minScale
const max =
- 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 reset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
reset() {
for (const i in types) {
const type = types[i]
this[type] = Object.assign({}, styles[type] || {})
for (const key in this[type]) {
- 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 drawText
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
drawText(text, anchor, attrs) {
// For equivalence w/ SVG text rendering
this.ctx.textBaseline = 'top'
this.ctx.font = `${attrs['font-size'] || '14px'} ${
- 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"