opensheetmusicdisplay/opensheetmusicdisplay

View on GitHub
src/MusicalScore/Graphical/BoundingBox.ts

Summary

Maintainability
F
2 wks
Test Coverage

File BoundingBox.ts has 555 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import log from "loglevel";
import {ArgumentOutOfRangeException} from "../Exceptions";
import {PointF2D} from "../../Common/DataObjects/PointF2D";
import {SizeF2D} from "../../Common/DataObjects/SizeF2D";
import {RectangleF2D} from "../../Common/DataObjects/RectangleF2D";
Severity: Major
Found in src/MusicalScore/Graphical/BoundingBox.ts - About 1 day to fix

    BoundingBox has 60 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class BoundingBox {
        protected isSymbol: boolean = false;
        protected relativePositionHasBeenSet: boolean = false;
        protected xBordersHaveBeenSet: boolean = false;
        protected yBordersHaveBeenSet: boolean = false;
    Severity: Major
    Found in src/MusicalScore/Graphical/BoundingBox.ts - About 1 day to fix

      Function calculateBoundingBox has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public calculateBoundingBox(ignoreClasses: string[] = []): void {
              if (this.childElements.length === 0) {
                  return;
              }
              for (let idx: number = 0, len: number = this.ChildElements.length; idx < len; ++idx) {
      Severity: Major
      Found in src/MusicalScore/Graphical/BoundingBox.ts - About 2 hrs to fix

        Function calculateBoundingBox has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            public calculateBoundingBox(ignoreClasses: string[] = []): void {
                if (this.childElements.length === 0) {
                    return;
                }
                for (let idx: number = 0, len: number = this.ChildElements.length; idx < len; ++idx) {
        Severity: Minor
        Found in src/MusicalScore/Graphical/BoundingBox.ts - About 1 hr 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 calculateMarginPositionAlongDirection has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private calculateMarginPositionAlongDirection(toBePlaced: BoundingBox, direction: ColDirEnum): void {
                // now this will be the "known" Element, about to get bigger with the toBePlaced
                // eg toBePlaced will always be in the PositionAndShape hierarchy a Child of this
                // example: this = StaffEntry, toBePlaced = Accidental
        
        
        Severity: Minor
        Found in src/MusicalScore/Graphical/BoundingBox.ts - About 1 hr to fix

          Function calculatePositionAlongDirection has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private calculatePositionAlongDirection(toBePlaced: BoundingBox, direction: ColDirEnum): void {
                  // now this will be the "known" Element, about to get bigger with the toBePlaced
                  // eg toBePlaced will always be in the PositionAndShape hierarchy a Child of this
                  // example: this = StaffEntry, toBePlaced = Accidental
          
          
          Severity: Minor
          Found in src/MusicalScore/Graphical/BoundingBox.ts - About 1 hr to fix

            Function getObjectsInRegion has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public getObjectsInRegion<T extends GraphicalObject>(region: BoundingBox, liesInside: boolean = true,
                                                                     className: string = GraphicalObject.name): T[] {
                    let result: T[] = [];
                    for (const child of this.childElements) {
                        result = result.concat(child.getObjectsInRegion<T>(region, liesInside, className));
            Severity: Minor
            Found in src/MusicalScore/Graphical/BoundingBox.ts - About 1 hr 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 calculateTopBottomBorders has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public calculateTopBottomBorders(): void {
                    if (this.childElements.length === 0) {
                        return;
                    }
                    for (let idx: number = 0, len: number = this.ChildElements.length; idx < len; ++idx) {
            Severity: Minor
            Found in src/MusicalScore/Graphical/BoundingBox.ts - About 1 hr to fix

              Avoid too many return statements within this function.
              Open

                                  return;
              Severity: Major
              Found in src/MusicalScore/Graphical/BoundingBox.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return;
                Severity: Major
                Found in src/MusicalScore/Graphical/BoundingBox.ts - About 30 mins to fix

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

                      public liesInsideMargins(psi: BoundingBox): boolean {
                          const leftMarginInside: boolean = (this.AbsolutePosition.x + this.borderMarginLeft) <= (psi.absolutePosition.x + psi.borderMarginLeft)
                              && (psi.absolutePosition.x + psi.borderMarginLeft) <= (this.AbsolutePosition.x + this.borderMarginRight);
                          const rightMarginInside: boolean = (this.AbsolutePosition.x + this.borderMarginLeft) <= (psi.absolutePosition.x + psi.borderMarginRight)
                              && (psi.absolutePosition.x + psi.borderMarginRight) <= (this.AbsolutePosition.x + this.borderMarginRight);
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 2 days to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 457..472

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

                  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

                      public liesInsideBorders(psi: BoundingBox): boolean {
                          const leftBorderInside: boolean = (this.AbsolutePosition.x + this.borderLeft) <= (psi.absolutePosition.x + psi.borderLeft)
                              && (psi.absolutePosition.x + psi.borderLeft) <= (this.AbsolutePosition.x + this.borderRight);
                          const rightBorderInside: boolean = (this.AbsolutePosition.x + this.borderLeft) <= (psi.absolutePosition.x + psi.borderRight)
                              && (psi.absolutePosition.x + psi.borderRight) <= (this.AbsolutePosition.x + this.borderRight);
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 2 days to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 506..521

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

                  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

                              switch (direction) {
                                  case ColDirEnum.Left:
                                      shiftDistance = (this.absolutePosition.x + this.borderLeft) - (toBePlaced.absolutePosition.x + toBePlaced.borderRight);
                                      toBePlaced.relativePosition.x += shiftDistance;
                                      toBePlaced.absolutePosition.x += shiftDistance;
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 1 day to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 641..664

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

                  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

                              switch (direction) {
                                  case ColDirEnum.Left:
                                      shiftDistance = (this.absolutePosition.x + this.borderMarginLeft) - (toBePlaced.absolutePosition.x + toBePlaced.borderMarginRight);
                                      toBePlaced.relativePosition.x += shiftDistance;
                                      toBePlaced.absolutePosition.x += shiftDistance;
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 1 day to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 692..715

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

                  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

                      public collisionDetection(psi: BoundingBox): boolean {
                          const overlapWidth: number = Math.min(this.AbsolutePosition.x + this.borderRight, psi.absolutePosition.x + psi.borderRight)
                              - Math.max(this.AbsolutePosition.x + this.borderLeft, psi.absolutePosition.x + psi.borderLeft);
                          const overlapHeight: number = Math.min(this.AbsolutePosition.y + this.borderBottom, psi.absolutePosition.y + psi.borderBottom)
                              - Math.max(this.AbsolutePosition.y + this.borderTop, psi.absolutePosition.y + psi.borderTop);
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 1 day to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 490..499

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

                  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

                      public marginCollisionDetection(psi: BoundingBox): boolean {
                          const overlapWidth: number = Math.min(this.AbsolutePosition.x + this.borderMarginRight, psi.absolutePosition.x + psi.borderMarginRight)
                              - Math.max(this.AbsolutePosition.x + this.borderMarginLeft, psi.absolutePosition.x + psi.borderMarginLeft);
                          const overlapHeight: number = Math.min(this.AbsolutePosition.y + this.borderMarginBottom, psi.absolutePosition.y + psi.borderMarginBottom)
                              - Math.max(this.AbsolutePosition.y + this.borderMarginTop, psi.absolutePosition.y + psi.borderMarginTop);
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 1 day to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 441..450

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

                  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

                      public pointLiesInsideBorders(position: PointF2D): boolean {
                          const xInside: boolean = (this.AbsolutePosition.x + this.borderLeft) <= position.x && position.x <= (this.AbsolutePosition.x + this.borderRight);
                          if (xInside) {
                              const yInside: boolean = (this.AbsolutePosition.y + this.borderTop) <= position.y && position.y <= (this.AbsolutePosition.y + this.borderBottom);
                              if (yInside) {
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 6 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 523..534

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

                  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

                      public pointLiesInsideMargins(position: PointF2D): boolean {
                          const xInside: boolean = (this.AbsolutePosition.x + this.borderMarginLeft) <= position.x
                              && position.x <= (this.AbsolutePosition.x + this.borderMarginRight);
                          if (xInside) {
                              const yInside: boolean = (this.AbsolutePosition.y + this.borderMarginTop) <= position.y
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 6 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 474..483

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

                  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

                          do {
                              switch (direction) {
                                  case ColDirEnum.Left:
                                  case ColDirEnum.Right:
                                      currentPosition = this.relativePosition.x;
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 6 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 415..433

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

                  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

                          do {
                              switch (direction) {
                                  case ColDirEnum.Left:
                                  case ColDirEnum.Right:
                                      currentPosition = this.relativePosition.x;
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 6 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 547..564

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

                  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

                      protected calculateMarginRectangle(): void {
                          this.upperLeftMarginCorner = new PointF2D(this.BorderMarginLeft, this.BorderMarginTop);
                          this.marginSize = new SizeF2D(this.BorderMarginRight - this.BorderMarginLeft, this.BorderMarginBottom - this.BorderMarginTop);
                          this.boundingMarginRectangle = RectangleF2D.createFromLocationAndSize(this.upperLeftMarginCorner, this.marginSize);
                      }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 3 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 611..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 96.

                  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

                      protected calculateRectangle(): void {
                          this.upperLeftCorner = new PointF2D(this.BorderLeft, this.BorderTop);
                          this.size = new SizeF2D(this.BorderRight - this.BorderLeft, this.BorderBottom - this.BorderTop);
                          this.boundingRectangle = RectangleF2D.createFromLocationAndSize(this.upperLeftCorner, this.size);
                      }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 3 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 617..621

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

                  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

                          for (let idx: number = 0, len: number = this.ChildElements.length; idx < len; ++idx) {
                              const child: BoundingBox = this.ChildElements[idx];
                              child.calculateAbsolutePositionsRecursive(this.absolutePosition.x, this.absolutePosition.y);
                          }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 2 other locations - About 2 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 280..283
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 290..293

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

                  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

                        for (let idx: number = 0, len: number = this.ChildElements.length; idx < len; ++idx) {
                          const child: BoundingBox = this.ChildElements[idx];
                          child.calculateAbsolutePositionsRecursive(this.absolutePosition.x, this.absolutePosition.y);
                        }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 2 other locations - About 2 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 265..268
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 280..283

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

                  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

                          for (let idx: number = 0, len: number = this.ChildElements.length; idx < len; ++idx) {
                              const child: BoundingBox = this.ChildElements[idx];
                              child.calculateAbsolutePositionsRecursive(this.absolutePosition.x, this.absolutePosition.y);
                          }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 2 other locations - About 2 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 265..268
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 290..293

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

                  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

                          for (let idx: number = 0, len: number = this.ChildElements.length; idx < len; ++idx) {
                              const childElement: BoundingBox = this.ChildElements[idx];
                              childElement.calculateMarginPositionAlongDirection(toBePlaced, direction);
                          }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 2 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 719..722

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

                  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

                          for (let idx: number = 0, len: number = this.ChildElements.length; idx < len; ++idx) {
                              const childElement: BoundingBox = this.ChildElements[idx];
                              childElement.calculatePositionAlongDirection(toBePlaced, direction);
                          }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/BoundingBox.ts and 1 other location - About 2 hrs to fix
                  src/MusicalScore/Graphical/BoundingBox.ts on lines 668..671

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

                  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