Showing 225 of 356 total issues
Function constructor
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(config: TweenConfig) {
var that = this,
node = config.node as any,
nodeId = node._id,
duration,
Function _tweenFunc
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
_tweenFunc(i) {
var node = this.node,
attrs = Tween.attrs[node._id][this._id],
key,
attr,
Function _getCachedSceneCanvas
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getCachedSceneCanvas() {
var filters = this.filters(),
cachedCanvas = this._getCanvasCache(),
sceneCanvas = cachedCanvas.scene,
filterCanvas = cachedCanvas.filter,
Function _fitNodesInto
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
_fitNodesInto(newAttrs, evt?) {
var oldAttrs = this._getNodeRect();
const minSize = 1;
- 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 _setTextData
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
_setTextData() {
const { width, height } = this._getTextSize(this.attrs.text);
this.textWidth = width;
this.textHeight = height;
this.glyphInfo = [];
- 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 Enhance
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export const Enhance: Filter = function (imageData) {
var data = imageData.data,
nSubPixels = data.length,
rMin = data[0],
rMax = rMin,
- 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 __getNodeRect
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
__getNodeRect() {
var node = this.getNode();
if (!node) {
return {
x: -MAX_SAFE_INTEGER,
Function _createBack
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createBack() {
var back = new Shape({
name: 'back',
width: 0,
height: 0,
Function Contrast
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const Contrast: Filter = function (imageData) {
var adjust = Math.pow((this.contrast() + 100) / 100, 2);
var data = imageData.data,
nPixels = data.length,
- 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 _isMatch
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
_isMatch(selector: string | Function) {
if (!selector) {
return false;
}
if (typeof selector === 'function') {
- 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 convertEndpointToCenterParameterization
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
static convertEndpointToCenterParameterization(
x1,
y1,
x2,
y2,
Function _hslColorToRGBA
has 50 lines of code (exceeds 25 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)!;
Function _sceneFunc
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
_sceneFunc(context) {
var ca = this.dataArray;
// context position
context.beginPath();
Function FromPolar
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
var FromPolar = function (src, dst, opt) {
var srcPixels = src.data,
dstPixels = dst.data,
xSize = src.width,
ySize = src.height,
Function smoothEdgeMask
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function smoothEdgeMask(mask, sw, sh) {
var weights = [1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9, 1 / 9];
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 _sceneFunc
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_sceneFunc(context) {
var ca = this.dataArray;
// context position
context.beginPath();
- 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 addComponentsGetterSetter
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
addComponentsGetterSetter(
constructor,
attr: string,
components: Array<string>,
validator?: Function,
- 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 _prepareToStringify
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
_prepareToStringify<T>(obj: any): T | null {
var desc;
obj.visitedByCircularReferenceRemoval = true;
- 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 setNodes
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
setNodes(nodes: Array<Node> = []) {
if (this._nodes && this._nodes.length) {
this.detach();
}
Function _sync
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
_sync() {
var text = this.getText(),
tag = this.getTag(),
width,
height,