lavrton/KineticJS

View on GitHub

Showing 225 of 354 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,
Severity: Major
Found in src/Tween.ts - About 2 hrs to fix

    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,
    Severity: Major
    Found in src/Tween.ts - About 2 hrs to fix

      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,
      Severity: Major
      Found in src/Node.ts - About 2 hrs to fix

        Function _fitNodesInto has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

          _fitNodesInto(newAttrs, evt?) {
            var oldAttrs = this._getNodeRect();
        
            const minSize = 1;
        
        
        Severity: Minor
        Found in src/shapes/Transformer.ts - About 2 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

        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,
        Severity: Minor
        Found in src/filters/Enhance.ts - About 2 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

        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 = [];
        Severity: Minor
        Found in src/shapes/TextPath.ts - About 2 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

        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,
        Severity: Major
        Found in src/shapes/Transformer.ts - About 2 hrs to fix

          Function _createBack has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            _createBack() {
              var back = new Shape({
                name: 'back',
                width: 0,
                height: 0,
          Severity: Major
          Found in src/shapes/Transformer.ts - About 2 hrs to fix

            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,
            Severity: Minor
            Found in src/filters/Contrast.ts - About 2 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

            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') {
            Severity: Minor
            Found in src/Node.ts - About 2 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

            Function convertEndpointToCenterParameterization has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              static convertEndpointToCenterParameterization(
                x1,
                y1,
                x2,
                y2,
            Severity: Major
            Found in src/shapes/Path.ts - About 2 hrs to fix

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

                _sceneFunc(context) {
                  var ca = this.dataArray;
              
                  // context position
                  context.beginPath();
              Severity: Minor
              Found in src/shapes/Path.ts - About 2 hrs to fix

                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)!;
                Severity: Minor
                Found in src/Util.ts - About 2 hrs to fix

                  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,
                  Severity: Minor
                  Found in src/filters/Kaleidoscope.ts - About 1 hr to fix

                    Function addComponentsGetterSetter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      addComponentsGetterSetter(
                        constructor,
                        attr: string,
                        components: Array<string>,
                        validator?: Function,
                    Severity: Minor
                    Found in src/Factory.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 a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _sceneFunc(context) {
                        var ca = this.dataArray;
                    
                        // context position
                        context.beginPath();
                    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 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);
                    
                    
                    Severity: Minor
                    Found in src/filters/Mask.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 _prepareToStringify has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      _prepareToStringify<T>(obj: any): T | null {
                        var desc;
                    
                        obj.visitedByCircularReferenceRemoval = true;
                    
                    
                    Severity: Minor
                    Found in src/Util.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 setNodes has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      setNodes(nodes: Array<Node> = []) {
                        if (this._nodes && this._nodes.length) {
                          this.detach();
                        }
                    
                    
                    Severity: Minor
                    Found in src/shapes/Transformer.ts - About 1 hr to fix

                      Function _sync has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _sync() {
                          var text = this.getText(),
                            tag = this.getTag(),
                            width,
                            height,
                      Severity: Minor
                      Found in src/shapes/Label.ts - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language