ReCreateJS/txtjs

View on GitHub

Showing 143 of 340 total issues

Consider simplifying this complex logical expression.
Open

            if i.has_attr('u1') and i.has_attr('u2') and i.has_attr('k'):
                #print( i['u1'] + ":" + i['u2'] + ":" + i['k'] )
                
                if "," in i['u1'] and len( i['u1'] ) > 1:
                    char_1 = i['u1'].split( ',' )
Severity: Critical
Found in tools/font_export/main.py - About 1 hr to fix

    Function init has 41 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/flipped.ts - About 1 hr to fix

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

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

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

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

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

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

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

              protected ligatureSwap(char: Character, ligTarget: string) {
                let advanceBy = 0;
                const firstChar = ligTarget.charAt(0);
                const firstLigature = char._font.ligatures[firstChar];
                //1 char match
            Severity: Minor
            Found in src/TextContainer.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 addDebugLayout has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              private addDebugLayout() {
                let s = new createjs.Shape();
                s.graphics.beginStroke("#FF0000");
                s.graphics.setStrokeStyle(0.1);
                s.graphics.decodeSVGPath(this.path);
            Severity: Minor
            Found in src/PathText.ts - About 1 hr to fix

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

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

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

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

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

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

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

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

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

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

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

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

                          Function layout has a Cognitive Complexity of 11 (exceeds 5 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

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

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

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

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

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

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

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

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

                                  Function addDebugLayout has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    private addDebugLayout() {
                                      const font: Font = FontLoader.getFont(this.font);
                                      //outline
                                      let s = new createjs.Shape();
                                      s.graphics.beginStroke("#FF0000");
                                  Severity: Minor
                                  Found in src/Text.ts - About 1 hr to fix

                                    Function addDebugLayout has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      private addDebugLayout() {
                                        const font: Font = FontLoader.getFont(this.font);
                                        //outline
                                        let s = new createjs.Shape();
                                        s.graphics.beginStroke("#FF0000");
                                    Severity: Minor
                                    Found in src/CharacterText.ts - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language