Showing 269 of 3,565 total issues
Function getCubicInterpolator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getCubicInterpolator(pointsFrom: XPoint[], pointsTo: XPoint[]) {
for (var i = 2; i < pointsFrom.length - 1; i += 3) {
pointsFrom[i - 1].isCubicControl = true;
pointsFrom[i].isCubicControl = 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
Function value
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
value: function (predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
- 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 _enableBrushing
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_enableBrushing(cols) {
const brushWidth = 16;
var columnsSelections = this.columnsSelections;
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
create(interval) {
const gen = this.periodGenerator;
var varSet = this.vars;
- 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 alignByX
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var alignByX = (exp) => {
return (prev) => {
return {
dx: (row) => {
- 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 alignByY
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
var alignByY = (exp) => {
return (prev) => {
return {
dy: (row) => {
- 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 setScrollPadding
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function setScrollPadding(el: HTMLElement, direction?: 'horizontal' | 'vertical' | 'both') {
direction = direction || 'both';
var isBottom = direction === 'horizontal' || direction === 'both';
var isRight = direction === 'vertical' || direction === 'both';
- 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 _handlePointerEvent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_handlePointerEvent(event: MouseEvent) {
// TODO: Highlight API seems not consistent.
// Just predicate is not enough, also
// need coordinates or event object.
const svgRect = this._svg.getBoundingClientRect();
- 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 getClosestElement
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getClosestElement(this: PointInstance, _cursorX, _cursorY) {
if (!this._boundsInfo) {
return null;
}
const {bounds, tree} = this._boundsInfo;
- 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 calcXYGuide
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
guide: UnitGuide,
settings: ChartSettings,
xMeta,
yMeta,
inlineLabels?: boolean,
Function getCirclesCurveTangents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getCirclesCurveTangents(a: Point, ca: Point, cb: Point, b: Point) {
var d = dist(a, b);
if (d === 0 ||
(d + a.size / 2 <= b.size / 2) ||
(d + b.size / 2 <= a.size / 2)
- 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 d3_transition_attr
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var d3_transition_attr = function (keyOrMap, value) {
var d3AttrResult = d3.transition.prototype.attr.apply(this, arguments);
if (arguments.length === 0) {
throw new Error('Unexpected `transition().attr()` arguments.');
- 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 calcUnitGuide
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var calcUnitGuide = function ({unit, meta, settings, allowXVertical, allowYVertical, inlineLabels}: CalcUnitArgs) {
var dimX = meta.dimension(unit.x);
var dimY = meta.dimension(unit.y);
- 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
Avoid deeply nested control flow statements. Open
if ((p1.y - c0.y) * (c3.y - p1.y) <= 0) {
tan = 0;
} else {
if (p1.y > c0.y === c2y > c3.y) {
kl = ((c3.y - p1.y) / (c2y - p1.y));
Function getScaleDiffFn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getScaleDiffFn(points1, points2) {
// Find remaining points with predictable position
var src = [];
var dst = [];
- 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 ruleExtractAxes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ruleExtractAxes(spec: GPLSpec) {
var isCoordsRect = (unitRef: Unit) => {
return (unitRef.type === 'COORDS.RECT' || unitRef.type === 'RECT');
};
- 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 getInnerInterpolator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getInnerInterpolator({polylineFrom, polylineTo, isCubic}) {
var oldCount = polylineFrom.length;
var newCount = polylineTo.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
Avoid deeply nested control flow statements. Open
if (source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
Avoid deeply nested control flow statements. Open
for (i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
Avoid deeply nested control flow statements. Open
if (h.from >= g.to && h.from < g.from) {
h.from++;
}