opensheetmusicdisplay/opensheetmusicdisplay

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

Summary

Maintainability
F
6 days
Test Coverage

File MusicSheetDrawer.ts has 541 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {EngravingRules} from "./EngravingRules";
import {ITextMeasurer} from "../Interfaces/ITextMeasurer";
import {GraphicalMusicSheet} from "./GraphicalMusicSheet";
import {BoundingBox} from "./BoundingBox";
import {GraphicalLayers, OutlineAndFillStyleEnum} from "./DrawingEnums";
Severity: Major
Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 1 day to fix

    MusicSheetDrawer has 51 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export abstract class MusicSheetDrawer {
        public drawingParameters: DrawingParameters;
        public splitScreenLineColor: number;
        public midiPlaybackAvailable: boolean;
        public drawableBoundingBoxElement: string = "None"; // process.env.DRAW_BOUNDING_BOX_ELEMENT;
    Severity: Major
    Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 7 hrs to fix

      Function drawMusicSystemComponents has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

          protected drawMusicSystemComponents(musicSystem: MusicSystem, systemBoundingBoxInPixels: RectangleF2D,
                                              absBoundingRectWithMargin: RectangleF2D): void {
              const selectStartSymb: SelectionStartSymbol = this.graphicalMusicSheet.SelectionStartSymbol;
              const selectEndSymb: SelectionEndSymbol = this.graphicalMusicSheet.SelectionEndSymbol;
              if (this.drawingParameters.drawSelectionStartSymbol) {
      Severity: Minor
      Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function drawMusicSystemComponents has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected drawMusicSystemComponents(musicSystem: MusicSystem, systemBoundingBoxInPixels: RectangleF2D,
                                              absBoundingRectWithMargin: RectangleF2D): void {
              const selectStartSymb: SelectionStartSymbol = this.graphicalMusicSheet.SelectionStartSymbol;
              const selectEndSymb: SelectionEndSymbol = this.graphicalMusicSheet.SelectionEndSymbol;
              if (this.drawingParameters.drawSelectionStartSymbol) {
      Severity: Major
      Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 2 hrs to fix

        Function drawStaffLineSymbols has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private drawStaffLineSymbols(staffLine: StaffLine): void {
                const parentInst: Instrument = staffLine.ParentStaff.ParentInstrument;
                const absX: number = staffLine.PositionAndShape.AbsolutePosition.x;
                const absY: number = staffLine.PositionAndShape.AbsolutePosition.y + 2;
                const borderRight: number = staffLine.PositionAndShape.BorderRight;
        Severity: Major
        Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 2 hrs to fix

          Function drawMarkedAreas has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              private drawMarkedAreas(system: MusicSystem): void {
                  for (const markedArea of system.GraphicalMarkedAreas) {
                      if (markedArea) {
                          if (markedArea.systemRectangle) {
                              this.drawRectangle(markedArea.systemRectangle, <number>GraphicalLayers.Background);
          Severity: Minor
          Found in src/MusicalScore/Graphical/MusicSheetDrawer.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 drawLabel has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public drawLabel(graphicalLabel: GraphicalLabel, layer: number): Node {
                  if (!this.isVisible(graphicalLabel.PositionAndShape)) {
                      return undefined;
                  }
                  const label: Label = graphicalLabel.Label;
          Severity: Minor
          Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 1 hr to fix

            Function drawStaffLineSymbols has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                private drawStaffLineSymbols(staffLine: StaffLine): void {
                    const parentInst: Instrument = staffLine.ParentStaff.ParentInstrument;
                    const absX: number = staffLine.PositionAndShape.AbsolutePosition.x;
                    const absY: number = staffLine.PositionAndShape.AbsolutePosition.y + 2;
                    const borderRight: number = staffLine.PositionAndShape.BorderRight;
            Severity: Minor
            Found in src/MusicalScore/Graphical/MusicSheetDrawer.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 drawBoundingBoxes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                private drawBoundingBoxes(startBox: BoundingBox, layer: number = 0, type: string = "all"): void {
                    const dataObjectString: string = (startBox.DataObject.constructor as any).name; // only works with non-minified build or sourcemap
                    let typeMatch: boolean = false;
                    if (type === "all") {
                        typeMatch = true;
            Severity: Minor
            Found in src/MusicalScore/Graphical/MusicSheetDrawer.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 drawSheet has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public drawSheet(graphicalMusicSheet: GraphicalMusicSheet): void {
                    this.graphicalMusicSheet = graphicalMusicSheet;
                    this.rules = graphicalMusicSheet.ParentMusicSheet.Rules;
                    this.drawSplitScreenLine();
                    if (this.drawingParameters.drawCursors) {
            Severity: Minor
            Found in src/MusicalScore/Graphical/MusicSheetDrawer.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 drawBoundingBoxes has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private drawBoundingBoxes(startBox: BoundingBox, layer: number = 0, type: string = "all"): void {
                    const dataObjectString: string = (startBox.DataObject.constructor as any).name; // only works with non-minified build or sourcemap
                    let typeMatch: boolean = false;
                    if (type === "all") {
                        typeMatch = true;
            Severity: Minor
            Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 1 hr to fix

              Function drawBoundingBox has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public drawBoundingBox(bbox: BoundingBox,
                      color: string = undefined, drawCross: boolean = false, labelText: string = undefined, layer: number = 0
                  ): Node {
                      let tmpRect: RectangleF2D = new RectangleF2D(bbox.AbsolutePosition.x + bbox.BorderMarginLeft,
                          bbox.AbsolutePosition.y + bbox.BorderMarginTop,
              Severity: Minor
              Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 1 hr to fix

                Function drawSheet has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public drawSheet(graphicalMusicSheet: GraphicalMusicSheet): void {
                        this.graphicalMusicSheet = graphicalMusicSheet;
                        this.rules = graphicalMusicSheet.ParentMusicSheet.Rules;
                        this.drawSplitScreenLine();
                        if (this.drawingParameters.drawCursors) {
                Severity: Minor
                Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 1 hr to fix

                  Function drawComment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private drawComment(system: MusicSystem): void {
                          for (const comment of system.GraphicalComments) {
                              if (comment) {
                                  if (comment.settings) {
                                      comment.settings.SVGNode = this.drawLabel(comment.settings, <number>GraphicalLayers.Comment);
                  Severity: Minor
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 55 mins 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 drawPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected drawPage(page: GraphicalMusicPage): void {
                          if (!this.isVisible(page.PositionAndShape)) {
                              return;
                          }
                  
                  
                  Severity: Minor
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 45 mins 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 drawStaffLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected drawStaffLine(staffLine: StaffLine): void {
                          for (const measure of staffLine.Measures) {
                              this.drawMeasure(measure);
                          }
                  
                  
                  Severity: Minor
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts - About 25 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                          if (this.drawingParameters.drawSelectionStartSymbol) {
                              if (selectStartSymb !== undefined && this.isVisible(selectStartSymb.PositionAndShape)) {
                                  this.drawSelectionStartSymbol(selectStartSymb);
                              }
                          }
                  Severity: Minor
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 1 other location - About 55 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 304..308

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 53.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          if (this.drawingParameters.drawSelectionEndSymbol) {
                              if (selectEndSymb !== undefined && this.isVisible(selectEndSymb.PositionAndShape)) {
                                  this.drawSelectionEndSymbol(selectEndSymb);
                              }
                          }
                  Severity: Minor
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 1 other location - About 55 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 299..303

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 53.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          const start: PointF2D = new PointF2D(line.Start.x + offset.x, line.Start.y + offset.y);
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 5 other locations - About 45 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 119..119
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 120..120
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 129..129
                  src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts on lines 179..179
                  src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts on lines 180..180

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          const end: PointF2D = new PointF2D(line.End.x + offset.x, line.End.y + offset.y);
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 5 other locations - About 45 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 119..119
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 120..120
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 128..128
                  src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts on lines 179..179
                  src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts on lines 180..180

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          const start: PointF2D = new PointF2D(line.Start.x + offset.x, line.Start.y + offset.y);
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 5 other locations - About 45 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 120..120
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 128..128
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 129..129
                  src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts on lines 179..179
                  src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts on lines 180..180

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          const end: PointF2D = new PointF2D(line.End.x + offset.x, line.End.y + offset.y);
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 5 other locations - About 45 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 119..119
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 128..128
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 129..129
                  src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts on lines 179..179
                  src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetDrawer.ts on lines 180..180

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          if (!this.leadSheet) {
                              for (const measureNumberLabel of musicSystem.MeasureNumberLabels) {
                                  measureNumberLabel.SVGNode = this.drawLabel(measureNumberLabel, <number>GraphicalLayers.Notes);
                              }
                          }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 2 other locations - About 40 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 327..332
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 515..519

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          if (this.rules.RenderSystemLabelsAfterFirstPage ||
                              musicSystem.Parent === musicSystem.Parent.Parent.MusicPages[0]) {
                              for (const label of musicSystem.Labels) {
                                  label.SVGNode = this.drawLabel(label, <number>GraphicalLayers.Notes);
                              }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 2 other locations - About 40 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 355..359
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 515..519

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                          if (page === page.Parent.MusicPages[0]) {
                              for (const label of page.Labels) {
                                  label.SVGNode = this.drawLabel(label, <number>GraphicalLayers.Notes);
                              }
                          }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 2 other locations - About 40 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 327..332
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 355..359

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

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

                                  if (comment.label) {
                                      comment.label.SVGNode = this.drawLabel(comment.label, <number>GraphicalLayers.Comment);
                                  }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 3 other locations - About 35 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 613..615
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 619..621
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 629..631

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

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

                                  if (markedArea.label) {
                                      markedArea.label.SVGNode = this.drawLabel(markedArea.label, <number>GraphicalLayers.Comment);
                                  }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 3 other locations - About 35 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 613..615
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 629..631
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 632..634

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

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

                                  if (comment.settings) {
                                      comment.settings.SVGNode = this.drawLabel(comment.settings, <number>GraphicalLayers.Comment);
                                  }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 3 other locations - About 35 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 613..615
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 619..621
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 632..634

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

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

                                  if (markedArea.settings) {
                                      markedArea.settings.SVGNode = this.drawLabel(markedArea.settings, <number>GraphicalLayers.Comment);
                                  }
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetDrawer.ts and 3 other locations - About 35 mins to fix
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 619..621
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 629..631
                  src/MusicalScore/Graphical/MusicSheetDrawer.ts on lines 632..634

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

                  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