Showing 7 of 36 total issues
File abstractChart.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { isArrayOfArrays, isArrayOfObjectsOrEmpty, getWidth, getHeight, randomId, makeAccessorFunction } from '../misc/utility'
import { select, event } from 'd3-selection'
import Scale from '../components/scale'
import Axis from '../components/axis'
import Tooltip from '../components/tooltip'
AbstractChart
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
export default class AbstractChart {
id = null
// base chart fields
data = null
Function mountBrush
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
mountBrush (whichBrush) {
if (!whichBrush) return
const brush = typeof whichBrush === 'string'
? whichBrush === 'x' ? brushX() : brushY()
: d3brush()
Function constructor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor ({
data,
target,
markers,
baselines,
Function constructor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
constructor ({
data,
xAccessor,
yAccessor,
y0Accessor,
- 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 normalizePoints
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
normalizePoints ({ points, isNested, aggregate, defined = null }) {
this.points = isNested
? points.map((pointArray, arrayIndex) => pointArray
.filter(p => !defined || defined(p))
.map((point, index) => ({
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor ({
data,
xAccessor,
yAccessor,
xScale,
- 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"