ReCreateJS/txtjs

View on GitHub
src/Text.ts

Summary

Maintainability
F
2 wks
Test Coverage
A
90%

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 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

File Text.ts has 415 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import TextContainer from "./TextContainer";
import Align from "./Align";
import FontLoader from "./FontLoader";
import Word from "./Word";
import Line from "./Line";
Severity: Minor
Found in src/Text.ts - About 5 hrs to fix

    Function wordLayout has 135 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      wordLayout() {
        // loop over words
        // place into lines
        const len = this.words.length;
        let currentLine = new Line();
    Severity: Major
    Found in src/Text.ts - About 5 hrs to fix

      Function characterLayout has 111 lines of code (exceeds 25 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: Major
      Found in src/Text.ts - About 4 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 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

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

              layout() {
                this.addAccessibility();
                this.text = this.text.replace(/([\n][ \t]+)/g, "\n");
                this.words = [];
                this.lines = [];
            Severity: Minor
            Found in src/Text.ts - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                      if (firstLine == false && this.lineHeight != null) {
                        currentLine.measuredHeight = this.lineHeight;
                      } else {
                        currentLine.measuredHeight = vPosition;
                      }
              Severity: Major
              Found in src/Text.ts - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                        if (this.lineHeight != null) {
                          lastHeight = currentLine.y + this.lineHeight;
                        } else {
                          lastHeight = currentLine.y + vPosition;
                        }
                Severity: Major
                Found in src/Text.ts - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                          if (i < len - 1) {
                            vPosition = 0;
                          }
                  Severity: Major
                  Found in src/Text.ts - About 45 mins to fix

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

                      private addDebugLayout() {
                        const font: Font = FontLoader.getFont(this.font);
                        //outline
                        let s = new createjs.Shape();
                        s.graphics.beginStroke("#FF0000");
                    Severity: Major
                    Found in src/Text.ts and 1 other location - About 3 days to fix
                    src/CharacterText.ts on lines 112..145

                    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 536.

                    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

                          if (this.align === a.TOP_CENTER) {
                            //move to center
                            line.x = (this.width - line.measuredWidth) / 2;
                          } else if (this.align === a.TOP_RIGHT) {
                            //move to right
                    Severity: Major
                    Found in src/Text.ts and 1 other location - About 1 day to fix
                    src/CharacterText.ts on lines 559..577

                    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 281.

                    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

                        if (
                          this.align === a.TOP_LEFT ||
                          this.align === a.TOP_CENTER ||
                          this.align === a.TOP_RIGHT
                        ) {
                    Severity: Major
                    Found in src/Text.ts and 1 other location - About 1 day to fix
                    src/CharacterText.ts on lines 581..615

                    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 260.

                    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

                          if (this.style !== null && this.style[i] !== undefined) {
                            currentStyle = this.style[i];
                            // make sure style contains properties needed.
                            if (currentStyle.size === undefined)
                              currentStyle.size = defaultStyle.size;
                    Severity: Major
                    Found in src/Text.ts and 1 other location - About 1 day to fix
                    src/CharacterText.ts on lines 328..345

                    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 244.

                    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 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

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

                          if (char.missing) {
                            if (this.missingGlyphs == null) {
                              this.missingGlyphs = [];
                            }
                            this.missingGlyphs.push({
                    Severity: Major
                    Found in src/Text.ts and 1 other location - About 2 hrs to fix
                    src/CharacterText.ts on lines 404..413

                    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 85.

                    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 3 locations. Consider refactoring.
                    Open

                        const defaultStyle: Style = {
                          size: this.size,
                          font: this.font,
                          tracking: this.tracking,
                          characterCase: this.characterCase,
                    Severity: Major
                    Found in src/Text.ts and 2 other locations - About 2 hrs to fix
                    src/CharacterText.ts on lines 305..313
                    src/PathText.ts on lines 329..337

                    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 77.

                    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

                          this.block.y =
                            (this.lines[0].measuredHeight * fnt.ascent) / fnt.units +
                            (this.lines[0].measuredHeight * fnt.top) / fnt.units;
                    Severity: Major
                    Found in src/Text.ts and 1 other location - About 1 hr to fix
                    src/CharacterText.ts on lines 589..591

                    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 74.

                    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

                          if (currentStyle.tracking == 0 && this.ligatures == true) {
                            const ligTarget = this.text.substr(i, 4);
                            i = i + this.ligatureSwap(char, ligTarget);
                          }
                    Severity: Major
                    Found in src/Text.ts and 1 other location - About 1 hr to fix
                    src/CharacterText.ts on lines 429..432

                    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 70.

                    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

                        if (currentWord.children.length == 0) {
                          currentWord = this.words[this.words.length - 1];
                          hPosition = currentWord.measuredWidth;
                          vPosition = currentWord.measuredHeight;
                        }
                    Severity: Major
                    Found in src/Text.ts and 1 other location - About 1 hr to fix
                    src/CharacterText.ts on lines 512..516

                    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 70.

                    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 3 locations. Consider refactoring.
                    Open

                            if (this.lineHeight != null) {
                              lastHeight = currentLine.y + this.lineHeight;
                            } else {
                              lastHeight = currentLine.y + vPosition;
                            }
                    Severity: Major
                    Found in src/Text.ts and 2 other locations - About 55 mins to fix
                    src/Text.ts on lines 322..326
                    src/Text.ts on lines 379..383

                    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 53.

                    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 3 locations. Consider refactoring.
                    Open

                            if (firstLine == false && this.lineHeight != null) {
                              currentLine.measuredHeight = this.lineHeight;
                            } else {
                              currentLine.measuredHeight = vPosition;
                            }
                    Severity: Major
                    Found in src/Text.ts and 2 other locations - About 55 mins to fix
                    src/Text.ts on lines 334..338
                    src/Text.ts on lines 415..419

                    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 53.

                    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 3 locations. Consider refactoring.
                    Open

                            if (this.lineHeight != null) {
                              lastHeight = currentLine.y + this.lineHeight;
                            } else {
                              lastHeight = currentLine.y + vPosition;
                            }
                    Severity: Major
                    Found in src/Text.ts and 2 other locations - About 55 mins to fix
                    src/Text.ts on lines 322..326
                    src/Text.ts on lines 409..413

                    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 53.

                    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 3 locations. Consider refactoring.
                    Open

                            if (this.lineHeight != null) {
                              lastHeight = currentLine.y + this.lineHeight;
                            } else {
                              lastHeight = currentLine.y + vPosition;
                            }
                    Severity: Major
                    Found in src/Text.ts and 2 other locations - About 55 mins to fix
                    src/Text.ts on lines 379..383
                    src/Text.ts on lines 409..413

                    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 53.

                    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 3 locations. Consider refactoring.
                    Open

                            if (firstLine == false && this.lineHeight != null) {
                              currentLine.measuredHeight = this.lineHeight;
                            } else {
                              currentLine.measuredHeight = vPosition;
                            }
                    Severity: Major
                    Found in src/Text.ts and 2 other locations - About 55 mins to fix
                    src/Text.ts on lines 334..338
                    src/Text.ts on lines 389..393

                    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 53.

                    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 3 locations. Consider refactoring.
                    Open

                            if (firstLine == false && this.lineHeight != null) {
                              currentLine.measuredHeight = this.lineHeight;
                            } else {
                              currentLine.measuredHeight = vPosition;
                            }
                    Severity: Major
                    Found in src/Text.ts and 2 other locations - About 55 mins to fix
                    src/Text.ts on lines 389..393
                    src/Text.ts on lines 415..419

                    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 53.

                    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

                        if (this.text === "" || this.text === undefined) {
                          this.render();
                          this.complete();
                          return;
                        }
                    Severity: Minor
                    Found in src/Text.ts and 1 other location - About 40 mins to fix
                    src/CharacterText.ts on lines 75..79

                    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 48.

                    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

                          if (FontLoader.isLoaded(currentStyle.font) === false) {
                            FontLoader.load(this, [currentStyle.font]);
                            return false;
                          }
                    Severity: Minor
                    Found in src/Text.ts and 2 other locations - About 40 mins to fix
                    src/CharacterText.ts on lines 392..395
                    src/PathText.ts on lines 369..372

                    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 48.

                    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

                    There are no issues that match your filters.

                    Category
                    Status