ReCreateJS/txtjs

View on GitHub

Showing 340 of 340 total issues

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

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

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

Severity: Major
Found in examples/Text/single_word_center_align_tracking.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/Text/multiline_line_height_smaller.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/single_word_center_align_tracking.ts on lines 3..36
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/CharacterText/multiline_line_height_larger.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/single_word_center_align_tracking.ts on lines 3..36
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/single_word_center_align_tracking.ts on lines 3..36
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/CharacterText/wordwrap_natural_newline.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/single_word_center_align_tracking.ts on lines 3..36
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/CharacterText/single_word_center_align_tracking.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/single_word_center_align_tracking.ts on lines 3..36
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/Text/multiline_line_height_smaller_breaks.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/single_word_center_align_tracking.ts on lines 3..36
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/Text/wordwrap_natural_newline.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/single_word_center_align_tracking.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/Text/multiline_line_height_larger.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/single_word_center_align_tracking.ts on lines 3..36
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/CharacterText/multiline_line_height_smaller.ts and 9 other locations - About 1 day to fix
examples/CharacterText/multiline_line_height_larger.ts on lines 3..36
examples/CharacterText/multiline_line_height_smaller_breaks.ts on lines 3..36
examples/CharacterText/single_word_center_align_tracking.ts on lines 3..36
examples/CharacterText/wordwrap_natural_newline.ts on lines 3..36
examples/Text/multiline_line_height_larger.ts on lines 3..36
examples/Text/multiline_line_height_smaller.ts on lines 3..35
examples/Text/multiline_line_height_smaller_breaks.ts on lines 3..37
examples/Text/single_word_center_align_tracking.ts on lines 3..36
examples/Text/wordwrap_natural_newline.ts on lines 3..36

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

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

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

Severity: Major
Found in examples/Text/multiline_align_breaks.ts and 5 other locations - About 1 day to fix
examples/CharacterText/multiline_align.ts on lines 3..35
examples/CharacterText/multiline_align_breaks.ts on lines 3..35
examples/CharacterText/single_word_oneline.ts on lines 3..35
examples/Text/multiline_align.ts on lines 3..35
examples/Text/single_word_oneline.ts on lines 3..35

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

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

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

Severity: Major
Found in examples/CharacterText/multiline_align.ts and 5 other locations - About 1 day to fix
examples/CharacterText/multiline_align_breaks.ts on lines 3..35
examples/CharacterText/single_word_oneline.ts on lines 3..35
examples/Text/multiline_align.ts on lines 3..35
examples/Text/multiline_align_breaks.ts on lines 3..35
examples/Text/single_word_oneline.ts on lines 3..35

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

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

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

Severity: Major
Found in examples/Text/multiline_align.ts and 5 other locations - About 1 day to fix
examples/CharacterText/multiline_align.ts on lines 3..35
examples/CharacterText/multiline_align_breaks.ts on lines 3..35
examples/CharacterText/single_word_oneline.ts on lines 3..35
examples/Text/multiline_align_breaks.ts on lines 3..35
examples/Text/single_word_oneline.ts on lines 3..35

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

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

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

Severity: Major
Found in examples/Text/single_word_oneline.ts and 5 other locations - About 1 day to fix
examples/CharacterText/multiline_align.ts on lines 3..35
examples/CharacterText/multiline_align_breaks.ts on lines 3..35
examples/CharacterText/single_word_oneline.ts on lines 3..35
examples/Text/multiline_align.ts on lines 3..35
examples/Text/multiline_align_breaks.ts on lines 3..35

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

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

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

Severity: Major
Found in examples/CharacterText/single_word_oneline.ts and 5 other locations - About 1 day to fix
examples/CharacterText/multiline_align.ts on lines 3..35
examples/CharacterText/multiline_align_breaks.ts on lines 3..35
examples/Text/multiline_align.ts on lines 3..35
examples/Text/multiline_align_breaks.ts on lines 3..35
examples/Text/single_word_oneline.ts on lines 3..35

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

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

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

Severity: Major
Found in examples/CharacterText/multiline_align_breaks.ts and 5 other locations - About 1 day to fix
examples/CharacterText/multiline_align.ts on lines 3..35
examples/CharacterText/single_word_oneline.ts on lines 3..35
examples/Text/multiline_align.ts on lines 3..35
examples/Text/multiline_align_breaks.ts on lines 3..35
examples/Text/single_word_oneline.ts on lines 3..35

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

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.flipped == false) {
        if (this.start > this.end) {
          if (this.align == PathAlign.Left) {
            realStart = this.start;
          } else if (this.align == PathAlign.Center) {
Severity: Major
Found in src/Path.ts and 1 other location - About 1 day to fix
src/Path.ts on lines 209..230

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

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

      } else {
        if (this.start > this.end) {
          if (this.align == PathAlign.Left) {
            realStart = this.start;
          } else if (this.align == PathAlign.Center) {
Severity: Major
Found in src/Path.ts and 1 other location - About 1 day to fix
src/Path.ts on lines 188..209

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

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