lavrton/KineticJS

View on GitHub

Showing 225 of 354 total issues

File Node.ts has 1787 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Util, Transform } from './Util';
import { Factory } from './Factory';
import { SceneCanvas, HitCanvas, Canvas } from './Canvas';
import { Konva } from './Global';
import { Container } from './Container';
Severity: Major
Found in src/Node.ts - About 4 days to fix

    File Transformer.ts has 1151 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Util, Transform } from '../Util';
    import { Factory } from '../Factory';
    import { Node } from '../Node';
    import { Shape } from '../Shape';
    import { Rect } from './Rect';
    Severity: Major
    Found in src/shapes/Transformer.ts - About 2 days to fix

      Node has 111 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export abstract class Node<Config extends NodeConfig = NodeConfig> {
        _id = idCounter++;
        eventListeners: {
          [index: string]: Array<{ name: string; handler: Function }>;
        } = {};
      Severity: Major
      Found in src/Node.ts - About 2 days to fix

        File Util.ts has 848 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { Konva } from './Global';
        import { Context } from './Context';
        import { IRect, RGB, RGBA, Vector2d } from './types';
        
        /*
        Severity: Major
        Found in src/Util.ts - About 2 days to fix

          File BezierFunctions.ts has 793 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Credits: rveciana/svg-path-properties
          
          // Legendre-Gauss abscissae (xi values, defined at i=n as the roots of the nth order Legendre polynomial Pn(x))
          export const tValues = [
            [],
          Severity: Major
          Found in src/BezierFunctions.ts - About 1 day to fix

            File Shape.ts has 785 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Konva } from './Global';
            import { Transform, Util } from './Util';
            import { Factory } from './Factory';
            import { Node, NodeConfig } from './Node';
            import {
            Severity: Major
            Found in src/Shape.ts - About 1 day to fix

              File Stage.ts has 775 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { Util } from './Util';
              import { Factory } from './Factory';
              import { Container, ContainerConfig } from './Container';
              import { Konva } from './Global';
              import { SceneCanvas, HitCanvas } from './Canvas';
              Severity: Major
              Found in src/Stage.ts - About 1 day to fix

                File Path.ts has 774 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { Factory } from '../Factory';
                import { Shape, ShapeConfig } from '../Shape';
                import { _registerNode } from '../Global';
                
                import { GetSet, PathSegment } from '../types';
                Severity: Major
                Found in src/shapes/Path.ts - About 1 day to fix

                  File Context.ts has 667 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { Util } from './Util';
                  import { Konva } from './Global';
                  import { Canvas } from './Canvas';
                  import { Shape } from './Shape';
                  import { IRect } from './types';
                  Severity: Major
                  Found in src/Context.ts - About 1 day to fix

                    Function parsePathData has 277 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      static parsePathData(data): PathSegment[] {
                        // Path Data Segment must begin with a moveTo
                        //m (x y)+  Relative moveTo (subsequent points are treated as lineTo)
                        //M (x y)+  Absolute moveTo (subsequent points are treated as lineTo)
                        //l (x y)+  Relative lineTo
                    Severity: Major
                    Found in src/shapes/Path.ts - About 1 day to fix

                      Function _setTextData has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                      Open

                        _setTextData() {
                          var lines = this.text().split('\n'),
                            fontSize = +this.fontSize(),
                            textWidth = 0,
                            lineHeightPx = this.lineHeight() * fontSize,
                      Severity: Minor
                      Found in src/shapes/Text.ts - About 1 day to fix

                      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 _handleMouseMove has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                      Open

                        _handleMouseMove(e) {
                          var x, y, newHypotenuse;
                          var anchorNode = this.findOne('.' + this._movingAnchorName)!;
                          var stage = anchorNode.getStage()!;
                      
                      
                      Severity: Minor
                      Found in src/shapes/Transformer.ts - About 1 day to fix

                      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 Emboss has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const Emboss: Filter = function (imageData) {
                        // pixastic strength is between 0 and 10.  I want it between 0 and 1
                        // pixastic greyLevel is between 0 and 255.  I want it between 0 and 1.  Also,
                        // a max value of greyLevel yields a white emboss, and the min value yields a black
                        // emboss.  Therefore, I changed greyLevel to whiteLevel
                      Severity: Minor
                      Found in src/filters/Emboss.ts - About 1 day to fix

                      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 Tween.ts has 586 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { Util } from './Util';
                      import { Animation } from './Animation';
                      import { Node, NodeConfig } from './Node';
                      import { Konva } from './Global';
                      import { Line } from './shapes/Line';
                      Severity: Major
                      Found in src/Tween.ts - About 1 day to fix

                        File Text.ts has 541 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { Util } from '../Util';
                        import { Context } from '../Context';
                        import { Factory } from '../Factory';
                        import { Shape, ShapeConfig } from '../Shape';
                        import { Konva } from '../Global';
                        Severity: Major
                        Found in src/shapes/Text.ts - About 1 day to fix

                          Function parsePathData has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                          Open

                            static parsePathData(data): PathSegment[] {
                              // Path Data Segment must begin with a moveTo
                              //m (x y)+  Relative moveTo (subsequent points are treated as lineTo)
                              //M (x y)+  Absolute moveTo (subsequent points are treated as lineTo)
                              //l (x y)+  Relative lineTo
                          Severity: Minor
                          Found in src/shapes/Path.ts - About 1 day to fix

                          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 filterGaussBlurRGBA has 214 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function filterGaussBlurRGBA(imageData, radius) {
                            var pixels = imageData.data,
                              width = imageData.width,
                              height = imageData.height;
                          
                          
                          Severity: Major
                          Found in src/filters/Blur.ts - About 1 day to fix

                            Context has 55 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            export class Context {
                              canvas: Canvas;
                              _context: CanvasRenderingContext2D;
                              traceArr: Array<String>;
                            
                            
                            Severity: Major
                            Found in src/Context.ts - About 7 hrs to fix

                              Function _handleMouseMove has 193 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                _handleMouseMove(e) {
                                  var x, y, newHypotenuse;
                                  var anchorNode = this.findOne('.' + this._movingAnchorName)!;
                                  var stage = anchorNode.getStage()!;
                              
                              
                              Severity: Major
                              Found in src/shapes/Transformer.ts - About 7 hrs to fix

                                Function _sceneFunc has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  _sceneFunc(context: Context) {
                                    var textArr = this.textArr,
                                      textArrLen = textArr.length;
                                
                                    if (!this.text()) {
                                Severity: Minor
                                Found in src/shapes/Text.ts - About 7 hrs to fix

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language