ReCreateJS/txtjs

View on GitHub

Showing 340 of 340 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  stage.addChild(
    new txt.PathText({
      x: 420,
      y: 420,
      flipped: true,
Severity: Major
Found in examples/PathText/flipped.ts and 1 other location - About 3 hrs to fix
examples/PathText/flipped.ts on lines 28..45

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 104.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  constructor(character: string, style: {}, index: number = null) {
    super();
    this.set(style);
    this.index = index;

Severity: Major
Found in src/Character.ts - About 3 hrs to fix

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

      stage.addChild(
        new txt.PathText({
          x: 300,
          y: 300,
          flipped: false,
    Severity: Major
    Found in examples/PathText/alignment.ts and 2 other locations - About 2 hrs to fix
    examples/PathText/alignment.ts on lines 139..155
    examples/PathText/alignment.ts on lines 157..173

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 94.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

      stage.addChild(
        new txt.PathText({
          x: 500,
          y: 500,
          flipped: false,
    Severity: Major
    Found in examples/PathText/alignment.ts and 2 other locations - About 2 hrs to fix
    examples/PathText/alignment.ts on lines 121..137
    examples/PathText/alignment.ts on lines 157..173

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 94.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

      stage.addChild(
        new txt.PathText({
          x: 700,
          y: 700,
          flipped: false,
    Severity: Major
    Found in examples/PathText/alignment.ts and 2 other locations - About 2 hrs to fix
    examples/PathText/alignment.ts on lines 121..137
    examples/PathText/alignment.ts on lines 139..155

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 94.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      lineLayout() {
        // loop over lines
        // place into text
        let measuredHeight = 0;
        let line;
    Severity: Minor
    Found in src/CharacterText.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 init has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

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

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

          stage.addChild(
            new txt.PathText({
              x: 100,
              y: 300,
              flipped: false,
        Severity: Major
        Found in examples/PathText/alignment.ts and 5 other locations - About 2 hrs to fix
        examples/PathText/alignment.ts on lines 10..26
        examples/PathText/alignment.ts on lines 28..44
        examples/PathText/alignment.ts on lines 46..62
        examples/PathText/alignment.ts on lines 64..81
        examples/PathText/alignment.ts on lines 102..119

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

          stage.addChild(
            new txt.PathText({
              x: 50,
              y: 50,
              flipped: false,
        Severity: Major
        Found in examples/PathText/alignment.ts and 5 other locations - About 2 hrs to fix
        examples/PathText/alignment.ts on lines 28..44
        examples/PathText/alignment.ts on lines 46..62
        examples/PathText/alignment.ts on lines 64..81
        examples/PathText/alignment.ts on lines 83..100
        examples/PathText/alignment.ts on lines 102..119

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

          stage.addChild(
            new txt.PathText({
              x: 300,
              y: 300,
              flipped: false,
        Severity: Major
        Found in examples/PathText/alignment.ts and 5 other locations - About 2 hrs to fix
        examples/PathText/alignment.ts on lines 10..26
        examples/PathText/alignment.ts on lines 46..62
        examples/PathText/alignment.ts on lines 64..81
        examples/PathText/alignment.ts on lines 83..100
        examples/PathText/alignment.ts on lines 102..119

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

          stage.addChild(
            new txt.PathText({
              x: 600,
              y: 600,
              flipped: false,
        Severity: Major
        Found in examples/PathText/alignment.ts and 5 other locations - About 2 hrs to fix
        examples/PathText/alignment.ts on lines 10..26
        examples/PathText/alignment.ts on lines 28..44
        examples/PathText/alignment.ts on lines 64..81
        examples/PathText/alignment.ts on lines 83..100
        examples/PathText/alignment.ts on lines 102..119

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

          stage.addChild(
            new txt.PathText({
              x: 100,
              y: 50,
              flipped: false,
        Severity: Major
        Found in examples/PathText/alignment.ts and 5 other locations - About 2 hrs to fix
        examples/PathText/alignment.ts on lines 10..26
        examples/PathText/alignment.ts on lines 28..44
        examples/PathText/alignment.ts on lines 46..62
        examples/PathText/alignment.ts on lines 83..100
        examples/PathText/alignment.ts on lines 102..119

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 6 locations. Consider refactoring.
        Open

          stage.addChild(
            new txt.PathText({
              x: 100,
              y: 600,
              flipped: false,
        Severity: Major
        Found in examples/PathText/alignment.ts and 5 other locations - About 2 hrs to fix
        examples/PathText/alignment.ts on lines 10..26
        examples/PathText/alignment.ts on lines 28..44
        examples/PathText/alignment.ts on lines 46..62
        examples/PathText/alignment.ts on lines 64..81
        examples/PathText/alignment.ts on lines 83..100

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 88.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                    hPosition =
                      char.x +
                      char._glyph.offset * char.size +
                      char.characterCaseOffset +
                      char.trackingOffset() +
            Severity: Major
            Found in src/Text.ts and 1 other location - About 2 hrs to fix
            src/Text.ts on lines 261..266

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 87.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                  hPosition =
                    char.x +
                    char._glyph.offset * char.size +
                    char.characterCaseOffset +
                    char.trackingOffset() +
            Severity: Major
            Found in src/Text.ts and 1 other location - About 2 hrs to fix
            src/Text.ts on lines 238..243

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 87.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    case "Z":
                      cmd = "Z";
                      if (startPoint) {
                        cpx = startPoint[0];
                        cpy = startPoint[1];
            Severity: Major
            Found in src/SVGPath.ts and 1 other location - About 2 hrs to fix
            src/SVGPath.ts on lines 252..264

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 86.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    case "z":
                      cmd = "Z";
                      if (startPoint) {
                        cpx = startPoint[0];
                        cpy = startPoint[1];
            Severity: Major
            Found in src/SVGPath.ts and 1 other location - About 2 hrs to fix
            src/SVGPath.ts on lines 266..278

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 86.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language