Showing 225 of 354 total issues
Function getPointAtLengthOfDataArray
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getPointAtLengthOfDataArray(length: number, dataArray) {
var point,
i = 0,
ii = dataArray.length;
Function _sceneFunc
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
_sceneFunc(context: Context) {
var width = this.width(),
height = this.height(),
pointerDirection = this.pointerDirection(),
pointerWidth = this.pointerWidth(),
Function _sceneFunc
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
_sceneFunc(ctx: Context) {
super._sceneFunc(ctx);
var PI2 = Math.PI * 2;
var points = this.points();
File TextPath.ts
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Util } from '../Util';
import { Factory } from '../Factory';
import { Context } from '../Context';
import { Shape, ShapeConfig } from '../Shape';
import { Path } from './Path';
Function calcLength
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
static calcLength(x, y, cmd, points) {
var len, p1, p2, t;
var path = Path;
switch (cmd) {
Function getTrace
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
getTrace(relaxed?: boolean, rounded?: boolean) {
var traceArr = this.traceArr,
len = traceArr.length,
str = '',
n,
- 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 Pixelate
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Pixelate: Filter = function (imageData) {
var pixelSize = Math.ceil(this.pixelSize()),
width = imageData.width,
height = imageData.height,
x,
Function _addAttr
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
_addAttr(key, end) {
var node = this.node,
nodeId = node._id,
start,
diff,
Function _setTextData
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setTextData() {
const { width, height } = this._getTextSize(this.attrs.text);
this.textWidth = width;
this.textHeight = height;
this.glyphInfo = [];
Function Kaleidoscope
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Kaleidoscope: Filter = function (imageData) {
var xSize = imageData.width,
ySize = imageData.height;
var x, y, xoff, i, r, g, b, a, srcPos, dstPos;
Function _hslColorToRGBA
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
_hslColorToRGBA(str: string) {
// Check hsl() format
if (/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(str)) {
// Extract h, s, l
const [_, ...hsl] = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(str)!;
- 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 _sceneFunc
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
_sceneFunc(context: Context) {
var points = this.points(),
length = points.length,
tension = this.tension(),
closed = this.closed(),
- 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 _fireAndBubble
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
_fireAndBubble(eventType, evt, compareShape?) {
if (evt && this.nodeType === SHAPE) {
evt.target = 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
File Blur.ts
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Factory } from '../Factory';
import { Node, Filter } from '../Node';
import { getNumberValidator } from '../Validators';
/*
the Gauss filter
Function getClientRect
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
getClientRect(
config: {
skipTransform?: boolean;
skipShadow?: boolean;
skipStroke?: boolean;
Function _pointermove
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
_pointermove(evt: TouchEvent | MouseEvent | PointerEvent) {
const events = getEventsMap(evt.type);
const eventType = getEventType(evt.type);
if (!events) {
return;
Function _sceneFunc
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
_sceneFunc(context: Context) {
var points = this.points(),
length = points.length,
tension = this.tension(),
closed = this.closed(),
Function dilateMask
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function dilateMask(mask, sw, sh) {
var weights = [1, 1, 1, 1, 1, 1, 1, 1, 1];
var side = Math.round(Math.sqrt(weights.length));
var halfSide = Math.floor(side / 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 erodeMask
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function erodeMask(mask, sw, sh) {
var weights = [1, 1, 1, 1, 0, 1, 1, 1, 1];
var side = Math.round(Math.sqrt(weights.length));
var halfSide = Math.floor(side / 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 drawScene
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawScene(can?: SceneCanvas, top?: Node, bufferCanvas?: SceneCanvas) {
// basically there are 3 drawing modes
// 1 - simple drawing when nothing is cached.
// 2 - when we are caching current
// 3 - when node is cached and we need to draw it into layer