Showing 143 of 340 total issues
Function init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function init() {
const canvas = createHiDPICanvas(610, 610, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
Function init
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function init() {
const canvas = createHiDPICanvas(500, 500, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
Function init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function init() {
const canvas = createHiDPICanvas(300, 200, 2);
document.body.appendChild(canvas);
const output = document.createElement("p");
Function init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function init() {
const canvas = createHiDPICanvas(500, 300, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
Function init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function init() {
const canvas = createHiDPICanvas(820, 900, 1);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function init() {
const canvas = createHiDPICanvas(1000, 1000, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
let i = 1;
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function init() {
const canvas = createHiDPICanvas(1000, 1000, 2);
document.body.appendChild(canvas);
const stage = new createjs.Stage(canvas);
let i = 1;
Function layout
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
layout() {
this.addAccessibility();
this.overset = false;
this.oversetIndex = null;
this.removeAllChildren();
- 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
Open
if (this.center > this.length) {
this.center = this.center - this.length;
}
Avoid deeply nested control flow statements. Open
Open
if (this.align == PathAlign.Left) {
realStart = this.start;
} else if (this.align == PathAlign.Center) {
realStart = this.start - (this.realLength - characterLength) / 2;
} else if (this.align == PathAlign.Right) {
Avoid deeply nested control flow statements. Open
Open
for k in char_2:
c_2 = k
if CHARS.has_key( c_2 ) and CHARS[ c_2 ] != 1:
c_2 = CHARS[ c_2 ]
Avoid deeply nested control flow statements. Open
Open
if (this.center > this.length) {
this.center = this.center - this.length;
}
Avoid deeply nested control flow statements. Open
Open
if (this.center > this.length) {
this.center = this.center - this.length;
}
Avoid deeply nested control flow statements. Open
Open
if (this.center > this.length) {
this.center = this.center - this.length;
}
Avoid deeply nested control flow statements. Open
Open
if (firstLine == false && this.lineHeight != null) {
currentLine.measuredHeight = this.lineHeight;
} else {
currentLine.measuredHeight = vPosition;
}
Avoid deeply nested control flow statements. Open
Open
for (let k = 0; k < pathLength; k++) {
if (target[path[k]] == undefined) {
target[path[k]] = {};
}
if (k == pathLength - 1) {
Avoid deeply nested control flow statements. Open
Open
if i.has_attr('horiz-adv-x') and i.has_attr('d'):
out += '1|' + unicode_str + '|' + i['horiz-adv-x'] + '|' + i['d'] + '\n'
elif i.has_attr('d') and i.has_attr('horiz-adv-x') == False:
out += '1|' + unicode_str + '|' + str( default ) + '|' + i['d'] + '\n'
Avoid deeply nested control flow statements. Open
Open
if (this.align == PathAlign.Left) {
realStart = this.start;
position = realStart - distance;
} else if (this.align == PathAlign.Center) {
realStart = this.start - (this.realLength - characterLength) / 2;
Avoid deeply nested control flow statements. Open
Open
if (this.align == PathAlign.Left) {
realStart = this.start;
} else if (this.align == PathAlign.Center) {
realStart = this.start + (this.realLength - characterLength) / 2;
} else if (this.align == PathAlign.Right) {
Avoid deeply nested control flow statements. Open
Open
if (this.lineHeight != null) {
lastHeight = currentLine.y + this.lineHeight;
} else {
lastHeight = currentLine.y + vPosition;
}