Showing 225 of 354 total issues
Function _getProjectionToSegment
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_getProjectionToSegment(x1, y1, x2, y2, x3, y3) {
Avoid deeply nested control flow statements. Open
if (shouldHandleEllipsis) {
this._tryToAddEllipsisToLastLine();
/*
* stop wrapping if wrapping is disabled or if adding
* one more line would overflow the fixed height
Avoid deeply nested control flow statements. Open
if (keepProportion) {
var comparePoint = centeredScaling
? {
x: this.width() / 2,
y: this.height() / 2,
Avoid deeply nested control flow statements. Open
if (substrWidth <= maxWidth) {
low = mid + 1;
match = substr;
matchWidth = substrWidth;
} else {
Function decompose
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
decompose() {
var a = this.m[0];
var b = this.m[1];
var c = this.m[2];
var d = this.m[3];
- 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 (y >= height) {
continue;
}
Function ElasticEaseOut
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ElasticEaseOut(t, b, c, d, a, p) {
Avoid deeply nested control flow statements. Open
if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {
var srcOff = scy * sw + scx;
var wt = weights[cy * side + cx];
a += mask[srcOff] * wt;
Function _sceneFunc
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_sceneFunc(context: Context) {
context.setAttr('font', this._getContextFont());
context.setAttr('textBaseline', this.textBaseline());
context.setAttr('textAlign', 'left');
context.save();
- 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 (line.length > 0) {
// Check if the remaining text would fit on one line
lineWidth = this._getTextWidth(line);
if (lineWidth <= maxWidth) {
// if it does, add the line and break out of the loop
Function ElasticEaseIn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ElasticEaseIn(t, b, c, d, a, p) {
Function ElasticEaseInOut
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ElasticEaseInOut(t, b, c, d, a, p) {
Avoid deeply nested control flow statements. Open
if (n % 2 === 0) {
newVal.push((start[n] || 0) + diff[n] * i);
} else {
newVal.push(
'rgba(' +
Avoid deeply nested control flow statements. Open
if (y >= height) {
continue;
}
Avoid deeply nested control flow statements. Open
if (scy >= 0 && scy < sh && scx >= 0 && scx < sw) {
var srcOff = scy * sw + scx;
var wt = weights[cy * side + cx];
a += mask[srcOff] * wt;
Function getPointOnLine
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static getPointOnLine(dist, P1x, P1y, P2x, P2y, fromX?, fromY?) {
if (fromX === undefined) {
fromX = P1x;
}
if (fromY === undefined) {
- 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
for (var idx = ca.length - 2; idx >= 0; idx--) {
if (ca[idx].command === 'M') {
cpx = ca[idx].points[0] + dx;
cpy = ca[idx].points[1] + dy;
break;
Avoid deeply nested control flow statements. Open
if (rounded) {
args = args.map((a) =>
typeof a === 'number' ? Math.floor(a) : a
);
}
Function drawHit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
drawHit(can?: HitCanvas, top?: Node, skipDragCheck = false) {
if (!this.shouldDrawHit(top, skipDragCheck)) {
return this;
}
- 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 getDerivative
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const getDerivative = (derivative: number, t: number, vs: number[]): number => {
// the derivative of any 't'-less function is zero.
const n = vs.length - 1;
let _vs;
let value;
- 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"