lavrton/KineticJS

View on GitHub

Showing 225 of 356 total issues

Function setPointersPositions has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  setPointersPositions(evt) {
    var contentPosition = this._getContentPosition(),
      x: number | null = null,
      y: number | null = null;
    evt = evt ? evt : window.event;
Severity: Minor
Found in src/Stage.ts - About 1 hr to fix

    Function getTrace has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getTrace(relaxed?: boolean, rounded?: boolean) {
        var traceArr = this.traceArr,
          len = traceArr.length,
          str = '',
          n,
    Severity: Minor
    Found in src/Context.ts - About 1 hr to fix

      Function _isMatch has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _isMatch(selector: string | Function) {
          if (!selector) {
            return false;
          }
          if (typeof selector === 'function') {
      Severity: Minor
      Found in src/Node.ts - About 1 hr to fix

        Function getCursor has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        function getCursor(anchorName, rad, rotateCursor) {
          if (anchorName === 'rotater') {
            return rotateCursor;
          }
        
        
        Severity: Minor
        Found in src/shapes/Transformer.ts - About 1 hr 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 Kaleidoscope has a Cognitive Complexity of 12 (exceeds 5 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;
        Severity: Minor
        Found in src/filters/Kaleidoscope.ts - About 1 hr 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 _stroke has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          _stroke(shape) {
            var dash = shape.dash(),
              // ignore strokeScaleEnabled for Text
              strokeScaleEnabled = shape.getStrokeScaleEnabled();
        
        
        Severity: Minor
        Found in src/Context.ts - About 1 hr 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 calcLength has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          static calcLength(x, y, cmd, points) {
            var len, p1, p2, t;
            var path = Path;
        
            switch (cmd) {
        Severity: Minor
        Found in src/shapes/Path.ts - About 1 hr 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 Solarize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        export const Solarize: Filter = function (imageData) {
          var data = imageData.data,
            w = imageData.width,
            h = imageData.height,
            w4 = w * 4,
        Severity: Minor
        Found in src/filters/Solarize.ts - About 1 hr 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 getAbsoluteZIndex has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          getAbsoluteZIndex() {
            var depth = this.getDepth(),
              that = this,
              index = 0,
              nodes,
        Severity: Minor
        Found in src/Node.ts - About 1 hr 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 _sceneFunc has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _sceneFunc(context: Context) {
            var anim = this.animation(),
              index = this.frameIndex(),
              ix4 = index * 4,
              set = this.animations()[anim],
        Severity: Minor
        Found in src/shapes/Sprite.ts - About 1 hr to fix

          Function decompose has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            decompose() {
              var a = this.m[0];
              var b = this.m[1];
              var c = this.m[2];
              var d = this.m[3];
          Severity: Minor
          Found in src/Util.ts - About 1 hr to fix

            Function getSelfRect has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              getSelfRect() {
                if (!this.glyphInfo.length) {
                  return {
                    x: 0,
                    y: 0,
            Severity: Minor
            Found in src/shapes/TextPath.ts - About 1 hr to fix

              Function drawHit has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                drawHit(can?: HitCanvas, top?: Node, skipDragCheck = false) {
                  if (!this.shouldDrawHit(top, skipDragCheck)) {
                    return this;
                  }
              
              
              Severity: Minor
              Found in src/Shape.ts - About 1 hr to fix

                Function _addListeners has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _addListeners() {
                    // start listeners
                    this.tween.onPlay = () => {
                      this.anim.start();
                    };
                Severity: Minor
                Found in src/Tween.ts - About 1 hr to fix

                  Function _createAnchor has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _createAnchor(name) {
                      var anchor = new Rect({
                        stroke: 'rgb(0, 161, 255)',
                        fill: 'white',
                        strokeWidth: 1,
                  Severity: Minor
                  Found in src/shapes/Transformer.ts - About 1 hr to fix

                    Function Contrast has 33 lines of code (exceeds 25 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,
                    Severity: Minor
                    Found in src/filters/Contrast.ts - About 1 hr to fix

                      Function ElasticEaseInOut has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        ElasticEaseInOut(t, b, c, d, a, p) {
                          // added s = 0
                          var s = 0;
                          if (t === 0) {
                            return b;
                      Severity: Minor
                      Found in src/Tween.ts - About 1 hr to fix

                        Function _pointerleave has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          _pointerleave(evt) {
                            const events = getEventsMap(evt.type);
                            const eventType = getEventType(evt.type);
                        
                            if (!events) {
                        Severity: Minor
                        Found in src/Stage.ts - About 1 hr to fix

                          Function _sceneFunc has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            _sceneFunc(context: Context) {
                              context.setAttr('font', this._getContextFont());
                              context.setAttr('textBaseline', this.textBaseline());
                              context.setAttr('textAlign', 'left');
                              context.save();
                          Severity: Minor
                          Found in src/shapes/TextPath.ts - About 1 hr to fix

                            Function _getAbsoluteTransform has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              _getAbsoluteTransform(top?: Node) {
                                var at: Transform;
                                // we we need position relative to an ancestor, we will iterate for all
                                if (top) {
                                  at = new Transform();
                            Severity: Minor
                            Found in src/Node.ts - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language