ReCreateJS/txtjs

View on GitHub
src/Path.ts

Summary

Maintainability
F
2 wks
Test Coverage
F
58%

Function getPathPoint has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring.
Open

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

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getPathPoint has 224 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

      update() {
        this.pathElement = document.createElementNS(
          "http://www.w3.org/2000/svg",
          "path"
        ) as SVGPathElement;
    Severity: Minor
    Found in src/Path.ts - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    File Path.ts has 393 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export enum PathFit {
      Rainbow,
      Stairstep
    }
    
    
    Severity: Minor
    Found in src/Path.ts - About 5 hrs to fix

      Function update has 106 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        update() {
          this.pathElement = document.createElementNS(
            "http://www.w3.org/2000/svg",
            "path"
          ) as SVGPathElement;
      Severity: Major
      Found in src/Path.ts - About 4 hrs to fix

        Avoid deeply nested control flow statements.
        Open

                  if (this.center > this.length) {
                    this.center = this.center - this.length;
                  }
        Severity: Major
        Found in src/Path.ts - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if (this.align == PathAlign.Left) {
                      realStart = this.start;
                    } else if (this.align == PathAlign.Center) {
                      realStart = this.start - (this.realLength - characterLength) / 2;
                    } else if (this.align == PathAlign.Right) {
          Severity: Major
          Found in src/Path.ts - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      if (this.center > this.length) {
                        this.center = this.center - this.length;
                      }
            Severity: Major
            Found in src/Path.ts - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                        if (this.center > this.length) {
                          this.center = this.center - this.length;
                        }
              Severity: Major
              Found in src/Path.ts - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if (this.center > this.length) {
                            this.center = this.center - this.length;
                          }
                Severity: Major
                Found in src/Path.ts - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if (this.align == PathAlign.Left) {
                              realStart = this.start;
                              position = realStart - distance;
                            } else if (this.align == PathAlign.Center) {
                              realStart = this.start - (this.realLength - characterLength) / 2;
                  Severity: Major
                  Found in src/Path.ts - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                              if (this.align == PathAlign.Left) {
                                realStart = this.start;
                              } else if (this.align == PathAlign.Center) {
                                realStart = this.start + (this.realLength - characterLength) / 2;
                              } else if (this.align == PathAlign.Right) {
                    Severity: Major
                    Found in src/Path.ts - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                if (this.align == PathAlign.Left) {
                                  realStart = this.start;
                                  position = realStart + distance;
                                } else if (this.align == PathAlign.Center) {
                                  realStart = this.start + (this.realLength - characterLength) / 2;
                      Severity: Major
                      Found in src/Path.ts - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if (position > this.length) {
                                    position = position - this.length;
                                  }
                        Severity: Major
                        Found in src/Path.ts - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                    if (this.align == PathAlign.Left) {
                                      realStart = this.start;
                                      position = realStart + distance;
                                    } else if (this.align == PathAlign.Center) {
                                      realStart = this.start + (this.realLength - characterLength) / 2;
                          Severity: Major
                          Found in src/Path.ts - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      if (this.align == PathAlign.Left) {
                                        realStart = this.start;
                                      } else if (this.align == PathAlign.Center) {
                                        realStart = this.start + (this.realLength - characterLength) / 2;
                                      } else if (this.align == PathAlign.Right) {
                            Severity: Major
                            Found in src/Path.ts - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if (this.align == PathAlign.Left) {
                                          realStart = this.start;
                                        } else if (this.align == PathAlign.Center) {
                                          realStart = this.start - (this.realLength - characterLength) / 2;
                                        } else if (this.align == PathAlign.Right) {
                              Severity: Major
                              Found in src/Path.ts - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          if (position < 0) {
                                            position = position + this.length;
                                          }
                                Severity: Major
                                Found in src/Path.ts - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                            if (this.align == PathAlign.Left) {
                                              realStart = this.start;
                                              position = realStart - distance;
                                            } else if (this.align == PathAlign.Center) {
                                              realStart = this.start - (this.realLength - characterLength) / 2;
                                  Severity: Major
                                  Found in src/Path.ts - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                              if (position < 0) {
                                                position = position + this.length;
                                              }
                                    Severity: Major
                                    Found in src/Path.ts - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                if (position > this.length) {
                                                  position = position - this.length;
                                                }
                                      Severity: Major
                                      Found in src/Path.ts - About 45 mins to fix

                                        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

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

                                                } else {
                                                  if (this.align == PathAlign.Left) {
                                                    realStart = this.start;
                                                    position = realStart - distance;
                                                  } else if (this.align == PathAlign.Center) {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 7 hrs to fix
                                        src/Path.ts on lines 290..306

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

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

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

                                        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.start > this.end) {
                                                  if (this.align == PathAlign.Left) {
                                                    realStart = this.start;
                                                    position = realStart + distance;
                                                  } else if (this.align == PathAlign.Center) {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 7 hrs to fix
                                        src/Path.ts on lines 327..342

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

                                        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.align == PathAlign.Left) {
                                                    realStart = this.start;
                                                    position = realStart + distance;
                                                  } else if (this.align == PathAlign.Center) {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 7 hrs to fix
                                        src/Path.ts on lines 262..277

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

                                        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.flipped == false) {
                                                if (this.start > this.end) {
                                                  this.realLength = this.start - this.end;
                                                  this.center = this.end + this.realLength / 2;
                                                } else {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 7 hrs to fix
                                        src/Path.ts on lines 148..159

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

                                        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

                                              } else {
                                                if (this.start > this.end) {
                                                  this.realLength = this.end + this.length - this.start;
                                                  this.center = this.start + this.realLength / 2;
                                                  if (this.center > this.length) {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 7 hrs to fix
                                        src/Path.ts on lines 137..148

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

                                        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

                                              } else {
                                                if (this.start > this.end) {
                                                  this.realLength = this.start - this.end;
                                                  this.center = this.end + this.realLength / 2;
                                                } else {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 7 hrs to fix
                                        src/Path.ts on lines 113..124

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

                                        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.flipped == false) {
                                                if (this.start > this.end) {
                                                  this.realLength = this.end + this.length - this.start;
                                                  this.center = this.start + this.realLength / 2;
                                                  if (this.center > this.length) {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 7 hrs to fix
                                        src/Path.ts on lines 124..135

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

                                        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

                                              } else {
                                                if (this.start > this.end) {
                                                  this.realLength = this.start - this.end;
                                                  this.center = this.start - this.realLength / 2;
                                                } else {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 4 hrs to fix
                                        src/Path.ts on lines 95..103

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

                                        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.flipped == false) {
                                                if (this.start > this.end) {
                                                  this.realLength = this.start - this.end;
                                                  this.center = this.start - this.realLength / 2;
                                                } else {
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 4 hrs to fix
                                        src/Path.ts on lines 103..111

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

                                        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

                                              const d0 = Math.sqrt(
                                                Math.pow(pp0.x - ppc["x"], 2) + Math.pow(pp0.y - ppc["y"], 2)
                                              );
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 1 hr to fix
                                        src/Path.ts on lines 366..368

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

                                        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

                                              const d1 = Math.sqrt(
                                                Math.pow(pp1.x - ppc["x"], 2) + Math.pow(pp1.y - ppc["y"], 2)
                                              );
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 1 hr to fix
                                        src/Path.ts on lines 362..364

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

                                        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

                                            let rot12 =
                                              (Math.atan((point2.y - point1.y) / (point2.x - point1.x)) * 180) /
                                              Math.PI;
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 1 hr to fix
                                        src/Path.ts on lines 374..376

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

                                        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

                                                let rot12 =
                                                  (Math.atan((point2.y - point1.y) / (point2.x - point1.x)) * 180) /
                                                  Math.PI;
                                        Severity: Major
                                        Found in src/Path.ts and 1 other location - About 1 hr to fix
                                        src/Path.ts on lines 404..406

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

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

                                              (points[1].x - points[0].x) * (points[1].y + points[0].y) +
                                              (points[2].x - points[1].x) * (points[2].y + points[1].y) +
                                        Severity: Major
                                        Found in src/Path.ts and 8 other locations - About 35 mins to fix
                                        src/Path.ts on lines 75..77
                                        src/Path.ts on lines 75..78
                                        src/Path.ts on lines 75..79
                                        src/Path.ts on lines 75..80
                                        src/Path.ts on lines 75..81
                                        src/Path.ts on lines 75..82
                                        src/Path.ts on lines 75..83
                                        src/Path.ts on lines 75..84

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

                                        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