Showing 143 of 340 total issues
Avoid deeply nested control flow statements. Open
if i.has_attr('glyph-name'):
print( 'CHARS[ "' + unicode_str + '" ] = 1' )
else:
print( 'CHARS[ "' + unicode_str + '" ] = 1 ' )
continue
Avoid deeply nested control flow statements. 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
if (i < len - 1) {
vPosition = 0;
}
Avoid deeply nested control flow statements. Open
if (position > this.length) {
position = position - this.length;
}
Avoid deeply nested control flow statements. Open
if CHARS.has_key( unicode_str ) and CHARS[ unicode_str ] != 1:
unicode_str = CHARS[ unicode_str ]
Avoid deeply nested control flow statements. 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;
Function update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
static update() {
Accessibility.timeout = null;
const data = Accessibility.data.slice(0);
data.sort(function(a, b) {
return a.accessibilityPriority - b.accessibilityPriority;
- 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 (
char._font.ligatures[ligTarget.charAt(0)][ligTarget.charAt(1)][
ligTarget.charAt(2)
]
) {
Avoid deeply nested control flow statements. Open
if i.has_attr('d') and i.has_attr('horiz-adv-x'):
out += '1|' + CHARS[ unicode_str ] + '|' + i['horiz-adv-x'] + '|' + i['d'] + '\n'
elif i.has_attr('d') and i.has_attr('horiz-adv-x') == False:
out += '1|' + CHARS[ unicode_str ] + '|' + str( default ) + '|' + i['d'] + '\n'
Function constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor(
x1: number[],
rx: number,
ry: number,
phiarg: number,
- 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 (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
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
if (position < 0) {
position = position + this.length;
}
Avoid deeply nested control flow statements. 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
if (position < 0) {
position = position + this.length;
}
Avoid deeply nested control flow statements. Open
if (position > this.length) {
position = position - this.length;
}
Function addText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function addText(font, tracking, xPos, yPos, size) {
Function addText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function addText(font, tracking, xPos, yPos, size) {
Function fontsFromCharacterStyles
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private fontsFromCharacterStyles(styles) {
const styleFonts = [];
if (styles) {
for (let i = 0; i < styles.length; ++i) {
if (styles[i] != undefined && styles[i].font != 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 too many return
statements within this function. Open
return this.text.charAt(index).charCodeAt(0);