ReCreateJS/txtjs

View on GitHub

Showing 143 of 340 total issues

Function filter_fonts has a Cognitive Complexity of 588 (exceeds 5 allowed). Consider refactoring.
Open

def filter_fonts():
    files = glob.glob( OUT_PATH + os.sep + '*.txt' )
    #target = 8
    #target_count = 0
    font_id = ""
Severity: Minor
Found in tools/font_export/invalid.py - About 1 wk 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 svg_to_txt has a Cognitive Complexity of 194 (exceeds 5 allowed). Consider refactoring.
Open

def svg_to_txt():
    files = glob.glob( SVG_PATH + os.sep + '*.svg' )
    #target = 8
    #target_count = 0
    font_id = ""
Severity: Minor
Found in tools/font_export/main.py - About 3 days 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 getPathPoint has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring.
Open

  getPathPoint(
    distance: number,
    characterLength = 0,
    charOffset = 0
  ): PathPoint {
Severity: Minor
Found in src/Path.ts - About 2 days 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 characterLayout has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
Open

  characterLayout(): boolean {
    //char layout
    const len = this.text.length;
    let char: Character;
    const defaultStyle: Style = {
Severity: Minor
Found in src/CharacterText.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 characterLayout has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
Open

  characterLayout(): boolean {
    //char layout
    let len = this.text.length;
    let char: Character;
    const defaultStyle: Style = {
Severity: Minor
Found in src/PathText.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 loadFont has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
Open

  static loadFont(fontName: string, loader: any) {
    //determine if font exists in memory
    if (FontLoader.fonts.hasOwnProperty(fontName)) {
      //loading complete
      if (FontLoader.fonts[fontName].loaded === true) {
Severity: Minor
Found in src/FontLoader.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 parsePathData has 268 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function wordLayout has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
    Open

      wordLayout() {
        // loop over words
        // place into lines
        const len = this.words.length;
        let currentLine = new Line();
    Severity: Minor
    Found in src/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 getPathPoint has 224 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getPathPoint(
        distance: number,
        characterLength = 0,
        charOffset = 0
      ): PathPoint {
    Severity: Major
    Found in src/Path.ts - About 1 day to fix

      Function update has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
      Open

        update() {
          this.pathElement = document.createElementNS(
            "http://www.w3.org/2000/svg",
            "path"
          ) as SVGPathElement;
      Severity: Minor
      Found in src/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 init has 209 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: Major
      Found in examples/CharacterText/autosize_reduce.ts - About 1 day to fix

        File invalid.py has 512 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        #!/usr/bin/python
        # -*- coding: latin-1 -*-
        
        import os
        import shutil
        Severity: Major
        Found in tools/font_export/invalid.py - About 1 day to fix

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

          export function parsePathData(data) {
            if (!data) {
              return [];
            }
            let cs = data;
          Severity: Minor
          Found in src/SVGPath.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 CharacterText.ts has 507 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import TextContainer from "./TextContainer";
          import Align from "./Align";
          import FontLoader from "./FontLoader";
          import { ConstructObj, Style } from "./Interfaces";
          import Font from "./Font";
          Severity: Major
          Found in src/CharacterText.ts - About 1 day to fix

            File vertical.py has 505 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            #!/usr/bin/python
            # -*- coding: utf8 -*-
            
            VERTICAL_OFFSET = {}
            VERTICAL_OFFSET[ 'amadeo_bold' ] = {}
            Severity: Major
            Found in tools/font_export/vertical.py - About 1 day to fix

              Function characterLayout has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
              Open

                characterLayout(): boolean {
                  //characterlayout adds Charcters to words and measures true height. LineHeight is not a factor til Line layout.
              
                  //char layout
                  const len = this.text.length;
              Severity: Minor
              Found in src/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 characterLayout has 199 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                characterLayout(): boolean {
                  //char layout
                  let len = this.text.length;
                  let char: Character;
                  const defaultStyle: Style = {
              Severity: Major
              Found in src/PathText.ts - About 7 hrs to fix

                File PathText.ts has 491 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import TextContainer from "./TextContainer";
                import { ConstructObj, Style } from "./Interfaces";
                import Path, { PathFit, PathAlign } from "./Path";
                import VerticalAlign from "./VerticalAlign";
                import FontLoader from "./FontLoader";
                Severity: Minor
                Found in src/PathText.ts - About 7 hrs to fix

                  Function characterLayout has 192 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    characterLayout(): boolean {
                      //char layout
                      const len = this.text.length;
                      let char: Character;
                      const defaultStyle: Style = {
                  Severity: Major
                  Found in src/CharacterText.ts - About 7 hrs to fix

                    File characters.py has 441 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    #!/usr/bin/python
                    # -*- coding: utf8 -*-
                    
                    #unicodeRange="U+0020-U+007E,U+00A1-U+00FF,U+2010-U+2036"
                    
                    
                    Severity: Minor
                    Found in tools/font_export/characters.py - About 6 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language