ReCreateJS/txtjs

View on GitHub

Showing 143 of 340 total issues

Function init has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function init() {
  const canvas = createHiDPICanvas(1000, 500, 1);
  document.body.appendChild(canvas);
  const stage = new createjs.Stage(canvas);

Severity: Major
Found in examples/CharacterText/stroke.ts - About 2 hrs to fix

    Function init has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function init() {
      const canvas = createHiDPICanvas(1000, 500, 1);
      document.body.appendChild(canvas);
      const stage = new createjs.Stage(canvas);
    
    
    Severity: Major
    Found in examples/Text/stroke.ts - About 2 hrs to fix

      Function constructor has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor(
          x1: number[],
          rx: number,
          ry: number,
          phiarg: number,
      Severity: Major
      Found in src/SVGArc.ts - About 2 hrs to fix

        File SVGPath.ts has 270 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        export function parsePathData(data) {
          if (!data) {
            return [];
          }
          let cs = data;
        Severity: Minor
        Found in src/SVGPath.ts - About 2 hrs to fix

          Function lineLayout has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            lineLayout() {
              // loop over lines
              // place into text
              let measuredHeight = 0;
              let line;
          Severity: Major
          Found in src/CharacterText.ts - About 2 hrs to fix

            Function lineLayout has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              lineLayout() {
                // loop over lines
                // place into text
                let measuredHeight = 0;
                let line;
            Severity: Major
            Found in src/Text.ts - About 2 hrs to fix

              Function init has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function init() {
                const canvas = createHiDPICanvas(350, 220, 2);
                document.body.appendChild(canvas);
                const stage = new createjs.Stage(canvas);
              
              
              Severity: Major
              Found in examples/Text/case.ts - About 2 hrs to fix

                Function init has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function init() {
                  const canvas = createHiDPICanvas(350, 220, 2);
                  document.body.appendChild(canvas);
                  const stage = new createjs.Stage(canvas);
                
                
                Severity: Major
                Found in examples/CharacterText/case.ts - About 2 hrs to fix

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

                    lineLayout() {
                      // loop over lines
                      // place into text
                      let measuredHeight = 0;
                      let line;
                  Severity: Minor
                  Found in src/Text.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

                  File main.py has 257 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  #!/usr/bin/python
                  # -*- coding: latin-1 -*-
                  
                  import os
                  import shutil
                  Severity: Minor
                  Found in tools/font_export/main.py - About 2 hrs to fix

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

                    export default function init() {
                      const canvas = createHiDPICanvas(1000, 1000, 2);
                      document.body.appendChild(canvas);
                      const stage = new createjs.Stage(canvas);
                    
                    
                    Severity: Minor
                    Found in examples/CharacterText/wordwrap.ts - About 1 hr to fix

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

                        layout() {
                          this.addAccessibility();
                      
                          this.overset = false;
                          this.measured = false;
                      Severity: Minor
                      Found in src/CharacterText.ts - About 1 hr to fix

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

                        export default function init() {
                          const canvas = createHiDPICanvas(910, 700, 2);
                          document.body.appendChild(canvas);
                          const stage = new createjs.Stage(canvas);
                        
                        
                        Severity: Minor
                        Found in examples/Text/wordwrap.ts - About 1 hr to fix

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

                          export default function createDemo(exampleElement) {
                            const canvas = createHiDPICanvas(500, 300, 2);
                            canvas.style.maxWidth = "100%";
                            exampleElement.appendChild(canvas);
                            stage = new createjs.Stage(canvas);
                          Severity: Minor
                          Found in site/demo.ts - About 1 hr to fix

                            Function init has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function init() {
                              const canvas = createHiDPICanvas(420, 420, 2);
                              document.body.appendChild(canvas);
                              const stage = new createjs.Stage(canvas);
                            
                            
                            Severity: Minor
                            Found in examples/PathText/accessibility.ts - About 1 hr to fix

                              Function init has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function init() {
                                const canvas = createHiDPICanvas(1080, 420, 1);
                                document.body.appendChild(canvas);
                                const stage = new createjs.Stage(canvas);
                              
                              
                              Severity: Minor
                              Found in examples/Graphics/pathGraphics.ts - About 1 hr to fix

                                Function init has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function init() {
                                  const canvas = createHiDPICanvas(500, 500, 2);
                                  document.body.appendChild(canvas);
                                  const stage = new createjs.Stage(canvas);
                                
                                
                                Severity: Minor
                                Found in examples/PathText/vertical_alignment.ts - About 1 hr to fix

                                  Function constructor has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    constructor(character: string, style: {}, index: number = null) {
                                      super();
                                      this.set(style);
                                      this.index = index;
                                  
                                  
                                  Severity: Minor
                                  Found in src/Character.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 init has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export default function init() {
                                    const canvas = createHiDPICanvas(500, 350, 1);
                                    document.body.appendChild(canvas);
                                    const stage = new createjs.Stage(canvas);
                                  
                                  
                                  Severity: Minor
                                  Found in examples/Graphics/pathGraphics2.ts - About 1 hr to fix

                                    Function init has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export default function init() {
                                      const canvas = createHiDPICanvas(420, 420, 2);
                                      document.body.appendChild(canvas);
                                      const stage = new createjs.Stage(canvas);
                                    
                                    
                                    Severity: Minor
                                    Found in examples/PathText/initial.ts - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language