Showing 34 of 126 total issues
Avoid deeply nested control flow statements. Open
Open
for(let j = 0; j < offscreens.length; j++) {
const ol = offscreens[j];
ol.render();
drawImage(layer, ol);
}
Avoid deeply nested control flow statements. Open
Open
if(svgNode.attributes.flexible) {
svgNode.attributes.textureRect = null;
}
Avoid deeply nested control flow statements. Open
Open
if(unit === 'vmax') {
size *= Math.max(width, height) / 100;
} else {
size *= Math.min(width, height) / 100;
}
Avoid deeply nested control flow statements. Open
Open
if(width == null) w = img.width / ratio;
Avoid deeply nested control flow statements. Open
Open
} else if(layer.prepareRender) {
layer.render();
}
Avoid deeply nested control flow statements. Open
Open
if(layer.prepareRender) layer.render();
Avoid deeply nested control flow statements. Open
Open
if(matched) {
let [, method, value] = matched;
if(method === 'rotate') value = Math.PI * parseFloat(value) / 180;
else value = value.trim().split(/[\s,]+/).map(v => toNumber(v));
if(method === 'matrix') {
Consider simplifying this complex logical expression. Open
Open
if(m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1 && m[4] === 0 && m[5] === 0) {
return null;
}
Consider simplifying this complex logical expression. Open
Open
if(typeof document !== 'undefined'
&& document.documentElement
&& document.documentElement.contains
&& target.layer
&& target.layer.canvas
Consider simplifying this complex logical expression. Open
Open
if(value != null && value !== 'none' && value !== 'visible' && value !== 'visibleFill' && value !== 'visibleStroke' && value !== 'all') {
throw new TypeError('Invalid pointerEvents type.');
}
Function createEllipseBorder
has 6 arguments (exceeds 5 allowed). Consider refactoring. Open
Open
function createEllipseBorder(figure, x, y, w, h, pos = 'leftTop') {
Function drawTexture
has a Cognitive Complexity of 27 (exceeds 25 allowed). Consider refactoring. Open
Open
export function drawTexture(node, mesh) {
const textureImage = node.textureImage instanceof String // for wechat miniprogram
? String(node.textureImage) : node.textureImage;
const textureImageRotated = node.textureImageRotated;
const texture = mesh.texture;
- 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
Open
return '';
Avoid too many return
statements within this function. Open
Open
return true;