opensheetmusicdisplay/opensheetmusicdisplay

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

Summary

Maintainability
F
2 mos
Test Coverage

File MusicSheetCalculator.ts has 2851 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { GraphicalStaffEntry } from "./GraphicalStaffEntry";
import { StaffLine } from "./StaffLine";
import { GraphicalMusicSheet } from "./GraphicalMusicSheet";
import { EngravingRules } from "./EngravingRules";
import { Tie } from "../VoiceData/Tie";
Severity: Major
Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 wk to fix

    Function calculateChordSymbols has a Cognitive Complexity of 134 (exceeds 5 allowed). Consider refactoring.
    Open

        protected calculateChordSymbols(): void {
            for (const musicSystem of this.musicSystems) {
                for (const staffLine of musicSystem.StaffLines) {
                    const skybottomcalculator: SkyBottomLineCalculator = staffLine.SkyBottomLineCalculator;
                    let minimumOffset: number = Number.MAX_SAFE_INTEGER; // only calculated if option set
    Severity: Minor
    Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 calculateGraphicalContinuousDynamic has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
    Open

        public calculateGraphicalContinuousDynamic(graphicalContinuousDynamic: GraphicalContinuousDynamicExpression, startPosInStaffline: PointF2D): void {
            const isSoftAccent: boolean = graphicalContinuousDynamic.IsSoftAccent;
            const staffIndex: number = graphicalContinuousDynamic.ParentStaffLine.ParentStaff.idInMusicSheet;
            // TODO: Previously the staffIndex was passed down. BUT you can (and this function actually does this) get it from
            // the musicSystem OR from the ParentStaffLine. Is this the same index?
    Severity: Minor
    Found in src/MusicalScore/Graphical/MusicSheetCalculator.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

    MusicSheetCalculator has 108 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export abstract class MusicSheetCalculator {
        public static symbolFactory: IGraphicalSymbolFactory;
        public static transposeCalculator: ITransposeCalculator;
        public static stafflineNoteCalculator: IStafflineNoteCalculator;
        protected static textMeasurer: ITextMeasurer;
    Severity: Major
    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 days to fix

      Function createGraphicalMeasure has a Cognitive Complexity of 98 (exceeds 5 allowed). Consider refactoring.
      Open

          private createGraphicalMeasure(sourceMeasure: SourceMeasure, openTuplets: Tuplet[], openBeams: Beam[],
                                         accidentalCalculator: AccidentalCalculator, activeClefs: ClefInstruction[],
                                         openOctaveShifts: OctaveShiftParams[], openLyricWords: LyricWord[], staffIndex: number,
                                         staffEntryLinks: StaffEntryLink[]): GraphicalMeasure {
              const staff: Staff = this.graphicalMusicSheet.ParentMusicSheet.getStaffFromIndex(staffIndex);
      Severity: Minor
      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function calculateFingerings has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring.
      Open

          public calculateFingerings(): void {
              if (this.rules.FingeringPosition === PlacementEnum.Left ||
                  this.rules.FingeringPosition === PlacementEnum.Right) {
                      return;
              }
      Severity: Minor
      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function calculateTupletNumbers has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
      Open

          protected calculateTupletNumbers(): void {
              if (!this.rules.TupletNumberLimitConsecutiveRepetitions) {
                  return;
              }
              let currentTupletNumber: number = -1;
      Severity: Minor
      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function calculateTempoExpressionsForMultiTempoExpression has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
      Open

          protected calculateTempoExpressionsForMultiTempoExpression(sourceMeasure: SourceMeasure, multiTempoExpression: MultiTempoExpression,
                                                                     measureIndex: number): void {
              // calculate absolute Timestamp
              const absoluteTimestamp: Fraction = Fraction.plus(sourceMeasure.AbsoluteTimestamp, multiTempoExpression.Timestamp);
              const measures: GraphicalMeasure[] = this.graphicalMusicSheet.MeasureList[measureIndex];
      Severity: Minor
      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function calculateGraphicalContinuousDynamic has 275 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public calculateGraphicalContinuousDynamic(graphicalContinuousDynamic: GraphicalContinuousDynamicExpression, startPosInStaffline: PointF2D): void {
              const isSoftAccent: boolean = graphicalContinuousDynamic.IsSoftAccent;
              const staffIndex: number = graphicalContinuousDynamic.ParentStaffLine.ParentStaff.idInMusicSheet;
              // TODO: Previously the staffIndex was passed down. BUT you can (and this function actually does this) get it from
              // the musicSystem OR from the ParentStaffLine. Is this the same index?
      Severity: Major
      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 day to fix

        Function createGraphicalTies has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
        Open

            protected createGraphicalTies(): void {
                for (let measureIndex: number = 0; measureIndex < this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length; measureIndex++) {
                    const sourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[measureIndex];
                    for (let staffIndex: number = 0; staffIndex < sourceMeasure.CompleteNumberOfStaves; staffIndex++) {
                        for (let j: number = 0; j < sourceMeasure.VerticalSourceStaffEntryContainers.length; j++) {
        Severity: Minor
        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 day to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function calculateMusicSystems has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
        Open

            protected calculateMusicSystems(): void {
                if (!this.graphicalMusicSheet.MeasureList) {
                    return;
                }
        
        
        Severity: Minor
        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 day to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function createGraphicalMeasure has 184 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private createGraphicalMeasure(sourceMeasure: SourceMeasure, openTuplets: Tuplet[], openBeams: Beam[],
                                           accidentalCalculator: AccidentalCalculator, activeClefs: ClefInstruction[],
                                           openOctaveShifts: OctaveShiftParams[], openLyricWords: LyricWord[], staffIndex: number,
                                           staffEntryLinks: StaffEntryLink[]): GraphicalMeasure {
                const staff: Staff = this.graphicalMusicSheet.ParentMusicSheet.getStaffFromIndex(staffIndex);
        Severity: Major
        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 7 hrs to fix

          Function handleVoiceEntry has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
          Open

              protected handleVoiceEntry(voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry,
                                         accidentalCalculator: AccidentalCalculator, openLyricWords: LyricWord[],
                                         activeClef: ClefInstruction,
                                         openTuplets: Tuplet[], openBeams: Beam[],
                                         octaveShiftValue: OctaveEnum, staffIndex: number,
          Severity: Minor
          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 6 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 prepareGraphicalMusicSheet has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

              public prepareGraphicalMusicSheet(): void {
                  // Clear the stored system images dict - all systems have to be redrawn.
                  // Not necessary now. TODO Check
                  // this.graphicalMusicSheet.SystemImages.length = 0;
                  const musicSheet: MusicSheet = this.graphicalMusicSheet.ParentMusicSheet;
          Severity: Minor
          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 calculateOrnaments has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
          Open

              private calculateOrnaments(): void {
                  for (let idx2: number = 0, len2: number = this.musicSystems.length; idx2 < len2; ++idx2) {
                      const system: MusicSystem = this.musicSystems[idx2];
                      for (let idx3: number = 0, len3: number = system.StaffLines.length; idx3 < len3; ++idx3) {
                          const line: StaffLine = system.StaffLines[idx3];
          Severity: Minor
          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 calculateMusicSystems has 131 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected calculateMusicSystems(): void {
                  if (!this.graphicalMusicSheet.MeasureList) {
                      return;
                  }
          
          
          Severity: Major
          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 5 hrs to fix

            Function clearSystemsAndMeasures has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                protected clearSystemsAndMeasures(): void {
                    for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
                        const graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
                        for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
                            const musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
            Severity: Minor
            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 4 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 prepareGraphicalMusicSheet has 100 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public prepareGraphicalMusicSheet(): void {
                    // Clear the stored system images dict - all systems have to be redrawn.
                    // Not necessary now. TODO Check
                    // this.graphicalMusicSheet.SystemImages.length = 0;
                    const musicSheet: MusicSheet = this.graphicalMusicSheet.ParentMusicSheet;
            Severity: Major
            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 4 hrs to fix

              Function handleStaffEntries has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  private handleStaffEntries(staffIsPercussionArray: Array<boolean>): void {
                      for (let idx: number = 0, len: number = this.graphicalMusicSheet.MeasureList.length; idx < len; ++idx) {
                          const measures: GraphicalMeasure[] = this.graphicalMusicSheet.MeasureList[idx];
                          for (let idx2: number = 0, len2: number = measures.length; idx2 < len2; ++idx2) {
                              const measure: GraphicalMeasure = measures[idx2];
              Severity: Minor
              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 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 calculateChordSymbols has 94 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected calculateChordSymbols(): void {
                      for (const musicSystem of this.musicSystems) {
                          for (const staffLine of musicSystem.StaffLines) {
                              const skybottomcalculator: SkyBottomLineCalculator = staffLine.SkyBottomLineCalculator;
                              let minimumOffset: number = Number.MAX_SAFE_INTEGER; // only calculated if option set
              Severity: Major
              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 hrs to fix

                Function calculateMoodAndUnknownExpression has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected calculateMoodAndUnknownExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
                        // calculate absolute Timestamp
                        const absoluteTimestamp: Fraction = multiExpression.AbsoluteTimestamp;
                        const measures: GraphicalMeasure[] = this.graphicalMusicSheet.MeasureList[measureIndex];
                        let relative: PointF2D = new PointF2D();
                Severity: Minor
                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 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 calculateSingleStaffLineLyricsPosition has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected calculateSingleStaffLineLyricsPosition(staffLine: StaffLine, lyricVersesNumber: string[]): GraphicalStaffEntry[] {
                        let numberOfVerses: number = 0;
                        let lyricsStartYPosition: number = this.rules.StaffHeight; // Add offset to prevent collision
                        const relevantVerseNumbers: Map<string, boolean> = new Map<string, boolean>();
                        const lyricsStaffEntriesList: GraphicalStaffEntry[] = [];
                Severity: Minor
                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 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 calculateTempoExpressionsForMultiTempoExpression has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected calculateTempoExpressionsForMultiTempoExpression(sourceMeasure: SourceMeasure, multiTempoExpression: MultiTempoExpression,
                                                                               measureIndex: number): void {
                        // calculate absolute Timestamp
                        const absoluteTimestamp: Fraction = Fraction.plus(sourceMeasure.AbsoluteTimestamp, multiTempoExpression.Timestamp);
                        const measures: GraphicalMeasure[] = this.graphicalMusicSheet.MeasureList[measureIndex];
                Severity: Major
                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 hrs to fix

                  Function calculateMeasureNumberPlacement has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected calculateMeasureNumberPlacement(musicSystem: MusicSystem): void {
                          const staffLine: StaffLine = musicSystem.StaffLines[0];
                          if (!staffLine || !staffLine.Measures[0]) {
                              log.warn("calculateMeasureNumberPlacement: measure undefined for system.Id " + musicSystem.Id);
                              return; // TODO apparently happens in script sometimes (mp #70)
                  Severity: Minor
                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 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 calculateXLayout has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public calculateXLayout(graphicalMusicSheet: GraphicalMusicSheet, maxInstrNameLabelLength: number): void {
                          // for each inner List in big Measure List calculate new Positions for the StaffEntries
                          // and adjust Measures sizes
                          // calculate max measure length for maximum zoom in.
                  
                  
                  Severity: Minor
                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 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 calculatePageLabels has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected calculatePageLabels(page: GraphicalMusicPage): void {
                          // The PositionAndShape child elements of page need to be manually connected to the lyricist, composer, subtitle, etc.
                          // because the page is only available now
                  
                          // fix width of SVG, sheet and horizontal scroll bar being too long (~32767 = SheetMaximumWidth) for single line scores
                  Severity: Major
                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 hrs to fix

                    Function setTieDirections has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private setTieDirections(staffEntry: GraphicalStaffEntry): void {
                            if (!staffEntry) {
                                return;
                            }
                            const ties: Tie[] = staffEntry.ties;
                    Severity: Minor
                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 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 calculateFingerings has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public calculateFingerings(): void {
                            if (this.rules.FingeringPosition === PlacementEnum.Left ||
                                this.rules.FingeringPosition === PlacementEnum.Right) {
                                    return;
                            }
                    Severity: Major
                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 hrs to fix

                      Function handleVoiceEntry has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected handleVoiceEntry(voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry,
                                                     accidentalCalculator: AccidentalCalculator, openLyricWords: LyricWord[],
                                                     activeClef: ClefInstruction,
                                                     openTuplets: Tuplet[], openBeams: Beam[],
                                                     octaveShiftValue: OctaveEnum, staffIndex: number,
                      Severity: Major
                      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 3 hrs to fix

                        Function calculateTupletNumbers has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected calculateTupletNumbers(): void {
                                if (!this.rules.TupletNumberLimitConsecutiveRepetitions) {
                                    return;
                                }
                                let currentTupletNumber: number = -1;
                        Severity: Major
                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                          Function checkMeasuresForWholeRestNotes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected checkMeasuresForWholeRestNotes(): void {
                                  for (let idx2: number = 0, len2: number = this.musicSystems.length; idx2 < len2; ++idx2) {
                                      const musicSystem: MusicSystem = this.musicSystems[idx2];
                                      for (let idx3: number = 0, len3: number = musicSystem.StaffLines.length; idx3 < len3; ++idx3) {
                                          const staffLine: StaffLine = musicSystem.StaffLines[idx3];
                          Severity: Minor
                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                          Cognitive Complexity

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

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

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

                          Further reading

                          Function calculateTieCurves has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private calculateTieCurves(): void {
                                  for (const musicSystem of this.musicSystems) {
                                      for (const staffLine of musicSystem.StaffLines) {
                                          for (const measure of staffLine.Measures) {
                                              for (const staffEntry of measure.staffEntries) {
                          Severity: Minor
                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                          Cognitive Complexity

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

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

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

                          Further reading

                          Function calculateStaffEntryArticulationMarks has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private calculateStaffEntryArticulationMarks(): void {
                                  for (let idx2: number = 0, len2: number = this.musicSystems.length; idx2 < len2; ++idx2) {
                                      const system: MusicSystem = this.musicSystems[idx2];
                                      for (let idx3: number = 0, len3: number = system.StaffLines.length; idx3 < len3; ++idx3) {
                                          const line: StaffLine = system.StaffLines[idx3];
                          Severity: Minor
                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                          Cognitive Complexity

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

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

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

                          Further reading

                          Function calculateSingleStaffLineLyricsPosition has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected calculateSingleStaffLineLyricsPosition(staffLine: StaffLine, lyricVersesNumber: string[]): GraphicalStaffEntry[] {
                                  let numberOfVerses: number = 0;
                                  let lyricsStartYPosition: number = this.rules.StaffHeight; // Add offset to prevent collision
                                  const relevantVerseNumbers: Map<string, boolean> = new Map<string, boolean>();
                                  const lyricsStaffEntriesList: GraphicalStaffEntry[] = [];
                          Severity: Major
                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Function optimizeRestNotePlacement has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected optimizeRestNotePlacement(graphicalStaffEntry: GraphicalStaffEntry, measure: GraphicalMeasure): void {
                                    if (graphicalStaffEntry.graphicalVoiceEntries.length === 0) {
                                        return;
                                    }
                                    const voice1Notes: GraphicalNote[] = graphicalStaffEntry.graphicalVoiceEntries[0].notes;
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function calculateDynamicExpressions has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private calculateDynamicExpressions(): void {
                                    const maxIndex: number = Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length - 1, this.rules.MaxMeasureToDrawIndex);
                                    const minIndex: number = Math.min(this.rules.MinMeasureToDrawIndex, this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length);
                                    for (let i: number = minIndex; i <= maxIndex; i++) {
                                        const sourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[i];
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function calculatePageLabels has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected calculatePageLabels(page: GraphicalMusicPage): void {
                                    // The PositionAndShape child elements of page need to be manually connected to the lyricist, composer, subtitle, etc.
                                    // because the page is only available now
                            
                                    // fix width of SVG, sheet and horizontal scroll bar being too long (~32767 = SheetMaximumWidth) for single line scores
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function calculateOctaveShifts has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private calculateOctaveShifts(): void {
                                    for (let i: number = 0; i < this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length; i++) {
                                        const sourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[i];
                                        for (let j: number = 0; j < sourceMeasure.StaffLinkedExpressions.length; j++) {
                                            if (!this.graphicalMusicSheet.MeasureList[i] || !this.graphicalMusicSheet.MeasureList[i][j]) {
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function getRelativePositionInStaffLineFromTimestamp has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected getRelativePositionInStaffLineFromTimestamp(
                                    timestamp: Fraction, verticalIndex: number, staffLine: StaffLine,
                                    multiStaffInstrument: boolean, firstVisibleMeasureRelativeX: number = 0.0,
                                    useLeftStaffEntryBorder: boolean = false
                                ): PointF2D {
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function calculatePedals has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private calculatePedals(): void {
                                    for (let i: number = 0; i < this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length; i++) {
                                        const sourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[i];
                                        for (let j: number = 0; j < sourceMeasure.StaffLinkedExpressions.length; j++) {
                                            if (!this.graphicalMusicSheet.MeasureList[i] || !this.graphicalMusicSheet.MeasureList[i][j]) {
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function calculateLyricExtend has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private calculateLyricExtend(lyricEntry: GraphicalLyricEntry): void {
                                    let startY: number = lyricEntry.GraphicalLabel.PositionAndShape.RelativePosition.y;
                                    const startStaffEntry: GraphicalStaffEntry = lyricEntry.StaffEntryParent;
                                    const startStaffLine: StaffLine = startStaffEntry.parentMeasure.ParentStaffLine;
                            
                            
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function calculateMoodAndUnknownExpressions has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private calculateMoodAndUnknownExpressions(): void {
                                    for (let i: number = 0; i < this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length; i++) {
                                        const sourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[i];
                                        for (let j: number = 0; j < sourceMeasure.StaffLinkedExpressions.length; j++) {
                                            if (!this.graphicalMusicSheet.MeasureList[i] || !this.graphicalMusicSheet.MeasureList[i][j]) {
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(graphicalStaffEntry: GraphicalStaffEntry): void {
                                    let restNote: GraphicalNote;
                                    let graphicalNotes: GraphicalNote[];
                                    if (graphicalStaffEntry.graphicalVoiceEntries[0].notes[0].sourceNote.isRest()) {
                                        restNote = graphicalStaffEntry.graphicalVoiceEntries[0].notes[0];
                            Severity: Minor
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                            Cognitive Complexity

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

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

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

                            Further reading

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

                                private calculateLyricExtend(lyricEntry: GraphicalLyricEntry): void {
                                    let startY: number = lyricEntry.GraphicalLabel.PositionAndShape.RelativePosition.y;
                                    const startStaffEntry: GraphicalStaffEntry = lyricEntry.StaffEntryParent;
                                    const startStaffLine: StaffLine = startStaffEntry.parentMeasure.ParentStaffLine;
                            
                            
                            Severity: Major
                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                              Function calculateGraphicalInstantaneousDynamicExpression has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  protected calculateGraphicalInstantaneousDynamicExpression(graphicalInstantaneousDynamic: GraphicalInstantaneousDynamicExpression,
                                                                                             startPosInStaffline: PointF2D, timestamp: Fraction): void {
                                      // get Margin Dimensions
                                      const staffLine: StaffLine = graphicalInstantaneousDynamic.ParentStaffLine;
                                      if (!staffLine) {
                              Severity: Minor
                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                              Cognitive Complexity

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

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

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

                              Further reading

                              Function calculateSingleLyricWord has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private calculateSingleLyricWord(lyricEntry: GraphicalLyricEntry): void {
                                      // const skyBottomLineCalculator: SkyBottomLineCalculator = new SkyBottomLineCalculator (this.rules);
                                      const graphicalLyricWord: GraphicalLyricWord = lyricEntry.ParentLyricWord;
                                      const index: number = graphicalLyricWord.GraphicalLyricsEntries.indexOf(lyricEntry);
                                      let nextLyricEntry: GraphicalLyricEntry = undefined;
                              Severity: Major
                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                                Function calculateSheetLabelBoundingBoxes has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected calculateSheetLabelBoundingBoxes(): void {
                                        const musicSheet: MusicSheet = this.graphicalMusicSheet.ParentMusicSheet;
                                        const defaultColorTitle: string = this.rules.DefaultColorTitle; // can be undefined => black
                                        if (musicSheet.Title !== undefined && this.rules.RenderTitle) {
                                            const title: GraphicalLabel = new GraphicalLabel(musicSheet.Title, this.rules.SheetTitleHeight, TextAlignmentEnum.CenterBottom, this.rules);
                                Severity: Major
                                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 2 hrs to fix

                                  Function calculateMoodAndUnknownExpression has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected calculateMoodAndUnknownExpression(multiExpression: MultiExpression, measureIndex: number, staffIndex: number): void {
                                          // calculate absolute Timestamp
                                          const absoluteTimestamp: Fraction = multiExpression.AbsoluteTimestamp;
                                          const measures: GraphicalMeasure[] = this.graphicalMusicSheet.MeasureList[measureIndex];
                                          let relative: PointF2D = new PointF2D();
                                  Severity: Minor
                                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

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

                                        private createAccidentalCalculators(): AccidentalCalculator[] {
                                            const accidentalCalculators: AccidentalCalculator[] = [];
                                            const firstSourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.getFirstSourceMeasure();
                                            if (firstSourceMeasure) {
                                                for (let i: number = 0; i < firstSourceMeasure.CompleteNumberOfStaves; i++) {
                                    Severity: Minor
                                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 getRelativePositionInStaffLineFromTimestamp has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        protected getRelativePositionInStaffLineFromTimestamp(
                                            timestamp: Fraction, verticalIndex: number, staffLine: StaffLine,
                                            multiStaffInstrument: boolean, firstVisibleMeasureRelativeX: number = 0.0,
                                            useLeftStaffEntryBorder: boolean = false
                                        ): PointF2D {
                                    Severity: Minor
                                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

                                      Function calculateGraphicalInstantaneousDynamicExpression has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected calculateGraphicalInstantaneousDynamicExpression(graphicalInstantaneousDynamic: GraphicalInstantaneousDynamicExpression,
                                                                                                     startPosInStaffline: PointF2D, timestamp: Fraction): void {
                                              // get Margin Dimensions
                                              const staffLine: StaffLine = graphicalInstantaneousDynamic.ParentStaffLine;
                                              if (!staffLine) {
                                      Severity: Minor
                                      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

                                        Function optimizeRestNotePlacement has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected optimizeRestNotePlacement(graphicalStaffEntry: GraphicalStaffEntry, measure: GraphicalMeasure): void {
                                                if (graphicalStaffEntry.graphicalVoiceEntries.length === 0) {
                                                    return;
                                                }
                                                const voice1Notes: GraphicalNote[] = graphicalStaffEntry.graphicalVoiceEntries[0].notes;
                                        Severity: Minor
                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

                                          Function calculateVerticalContainersList has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              private calculateVerticalContainersList(): void {
                                                  const numberOfEntries: number = this.graphicalMusicSheet.MeasureList[0].length;
                                                  for (let i: number = 0; i < this.graphicalMusicSheet.MeasureList.length; i++) {
                                                      for (let j: number = 0; j < numberOfEntries; j++) {
                                                          const measure: GraphicalMeasure = this.graphicalMusicSheet.MeasureList[i][j];
                                          Severity: Minor
                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 handleTie has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              private handleTie(tie: Tie, startGraphicalStaffEntry: GraphicalStaffEntry, staffIndex: number, measureIndex: number): void {
                                                  if (!startGraphicalStaffEntry) {
                                                      // console.log('tie not found in measure number ' + measureIndex - 1);
                                                      return;
                                                  }
                                          Severity: Minor
                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 clearSystemsAndMeasures has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              protected clearSystemsAndMeasures(): void {
                                                  for (let idx: number = 0, len: number = this.graphicalMusicSheet.MusicPages.length; idx < len; ++idx) {
                                                      const graphicalMusicPage: GraphicalMusicPage = this.graphicalMusicSheet.MusicPages[idx];
                                                      for (let idx2: number = 0, len2: number = graphicalMusicPage.MusicSystems.length; idx2 < len2; ++idx2) {
                                                          const musicSystem: MusicSystem = graphicalMusicPage.MusicSystems[idx2];
                                          Severity: Minor
                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

                                            Function calculateMeasureNumberPlacement has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                protected calculateMeasureNumberPlacement(musicSystem: MusicSystem): void {
                                                    const staffLine: StaffLine = musicSystem.StaffLines[0];
                                                    if (!staffLine || !staffLine.Measures[0]) {
                                                        log.warn("calculateMeasureNumberPlacement: measure undefined for system.Id " + musicSystem.Id);
                                                        return; // TODO apparently happens in script sometimes (mp #70)
                                            Severity: Minor
                                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

                                              Function calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  private calculateRestNotePlacementWithCollisionDetectionFromGraphicalNote(graphicalStaffEntry: GraphicalStaffEntry): void {
                                                      let restNote: GraphicalNote;
                                                      let graphicalNotes: GraphicalNote[];
                                                      if (graphicalStaffEntry.graphicalVoiceEntries[0].notes[0].sourceNote.isRest()) {
                                                          restNote = graphicalStaffEntry.graphicalVoiceEntries[0].notes[0];
                                              Severity: Minor
                                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

                                                Function createGraphicalTies has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    protected createGraphicalTies(): void {
                                                        for (let measureIndex: number = 0; measureIndex < this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length; measureIndex++) {
                                                            const sourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[measureIndex];
                                                            for (let staffIndex: number = 0; staffIndex < sourceMeasure.CompleteNumberOfStaves; staffIndex++) {
                                                                for (let j: number = 0; j < sourceMeasure.VerticalSourceStaffEntryContainers.length; j++) {
                                                Severity: Minor
                                                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

                                                  Function calculateXLayout has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      public calculateXLayout(graphicalMusicSheet: GraphicalMusicSheet, maxInstrNameLabelLength: number): void {
                                                          // for each inner List in big Measure List calculate new Positions for the StaffEntries
                                                          // and adjust Measures sizes
                                                          // calculate max measure length for maximum zoom in.
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

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

                                                        private calculateSingleMeasureNumberPlacement(measure: GraphicalMeasure, staffLine: StaffLine, musicSystem: MusicSystem,
                                                                                                      labelOffsetX: number = 0): void {
                                                            const labelNumber: string = measure.parentSourceMeasure.getPrintedMeasureNumber().toString();
                                                            const label: Label = new Label(labelNumber);
                                                            // maybe give rules as argument instead of just setting fontStyle and maybe other settings manually afterwards
                                                    Severity: Minor
                                                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

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

                                                          protected calculateLabel(staffLine: StaffLine,
                                                                                   relative: PointF2D,
                                                                                   combinedString: string,
                                                                                   style: FontStyles,
                                                                                   placement: PlacementEnum,
                                                      Severity: Minor
                                                      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

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

                                                            private calculateSingleLyricWord(lyricEntry: GraphicalLyricEntry): void {
                                                                // const skyBottomLineCalculator: SkyBottomLineCalculator = new SkyBottomLineCalculator (this.rules);
                                                                const graphicalLyricWord: GraphicalLyricWord = lyricEntry.ParentLyricWord;
                                                                const index: number = graphicalLyricWord.GraphicalLyricsEntries.indexOf(lyricEntry);
                                                                let nextLyricEntry: GraphicalLyricEntry = undefined;
                                                        Severity: Minor
                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 calculateStemDirectionFromVoices has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            private calculateStemDirectionFromVoices(voiceEntry: VoiceEntry): void {
                                                                // Stem direction calculation:
                                                                const hasLink: boolean = voiceEntry.ParentSourceStaffEntry.Link !== undefined;
                                                                if (hasLink) {
                                                                    // in case of StaffEntryLink don't check mainVoice / linkedVoice
                                                        Severity: Minor
                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 setBeamNotesWantedStemDirections has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                        Open

                                                            private setBeamNotesWantedStemDirections(voiceEntry: VoiceEntry): void {
                                                                if (!(voiceEntry.Notes.length > 0)) {
                                                                    return;
                                                                }
                                                                // don't just set direction if undefined. if there's a note in the beam with a different stem direction, Vexflow draws it with an unending stem.
                                                        Severity: Minor
                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 setTieDirections has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            private setTieDirections(staffEntry: GraphicalStaffEntry): void {
                                                                if (!staffEntry) {
                                                                    return;
                                                                }
                                                                const ties: Tie[] = staffEntry.ties;
                                                        Severity: Minor
                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

                                                          Function calculateSheetLabelBoundingBoxes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected calculateSheetLabelBoundingBoxes(): void {
                                                                  const musicSheet: MusicSheet = this.graphicalMusicSheet.ParentMusicSheet;
                                                                  const defaultColorTitle: string = this.rules.DefaultColorTitle; // can be undefined => black
                                                                  if (musicSheet.Title !== undefined && this.rules.RenderTitle) {
                                                                      const title: GraphicalLabel = new GraphicalLabel(musicSheet.Title, this.rules.SheetTitleHeight, TextAlignmentEnum.CenterBottom, this.rules);
                                                          Severity: Minor
                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 calculateLyricsExtendsAndDashes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              protected calculateLyricsExtendsAndDashes(lyricsStaffEntries: GraphicalStaffEntry[]): void {
                                                                  // iterate again to create now the extend lines and dashes for words
                                                                  for (let idx: number = 0, len: number = lyricsStaffEntries.length; idx < len; ++idx) {
                                                                      const staffEntry: GraphicalStaffEntry = lyricsStaffEntries[idx];
                                                                      // set LyricEntryLabel RelativePosition
                                                          Severity: Minor
                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 optimizeRestPlacement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                          Open

                                                              private optimizeRestPlacement(): void {
                                                                  for (let idx2: number = 0, len2: number = this.musicSystems.length; idx2 < len2; ++idx2) {
                                                                      const system: MusicSystem = this.musicSystems[idx2];
                                                                      for (let idx3: number = 0, len3: number = system.StaffLines.length; idx3 < len3; ++idx3) {
                                                                          const line: StaffLine = system.StaffLines[idx3];
                                                          Severity: Minor
                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 handleTie has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                              private handleTie(tie: Tie, startGraphicalStaffEntry: GraphicalStaffEntry, staffIndex: number, measureIndex: number): void {
                                                                  if (!startGraphicalStaffEntry) {
                                                                      // console.log('tie not found in measure number ' + measureIndex - 1);
                                                                      return;
                                                                  }
                                                          Severity: Minor
                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

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

                                                                private handleStaffEntries(staffIsPercussionArray: Array<boolean>): void {
                                                                    for (let idx: number = 0, len: number = this.graphicalMusicSheet.MeasureList.length; idx < len; ++idx) {
                                                                        const measures: GraphicalMeasure[] = this.graphicalMusicSheet.MeasureList[idx];
                                                                        for (let idx2: number = 0, len2: number = measures.length; idx2 < len2; ++idx2) {
                                                                            const measure: GraphicalMeasure = measures[idx2];
                                                            Severity: Minor
                                                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 1 hr to fix

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

                                                                  private calculateLyricsPosition(): void {
                                                                      const lyricStaffEntriesDict: Dictionary<StaffLine, GraphicalStaffEntry[]> = new Dictionary<StaffLine, GraphicalStaffEntry[]>();
                                                                      // sort the lyriceVerseNumbers for every Instrument that has Lyrics
                                                                      for (let idx: number = 0, len: number = this.graphicalMusicSheet.ParentMusicSheet.Instruments.length; idx < len; ++idx) {
                                                                          const instrument: Instrument = this.graphicalMusicSheet.ParentMusicSheet.Instruments[idx];
                                                              Severity: Minor
                                                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.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 calculateSingleMeasureNumberPlacement has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                              Open

                                                                  private calculateSingleMeasureNumberPlacement(measure: GraphicalMeasure, staffLine: StaffLine, musicSystem: MusicSystem,
                                                                                                                labelOffsetX: number = 0): void {
                                                                      const labelNumber: string = measure.parentSourceMeasure.getPrintedMeasureNumber().toString();
                                                                      const label: Label = new Label(labelNumber);
                                                                      // maybe give rules as argument instead of just setting fontStyle and maybe other settings manually afterwards
                                                              Severity: Minor
                                                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.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

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                      if (firstNote.NoteTuplet !== currentTuplet) {
                                                                                          if (disabledPerVoice[voice.VoiceId][firstNote.NoteTuplet.TupletLabelNumber]) {
                                                                                              if (disabledPerVoice[voice.VoiceId][firstNote.NoteTuplet.TupletLabelNumber][typeLength.RealValue]) {
                                                                                                  firstNote.NoteTuplet.RenderTupletNumber = false;
                                                                                                  skipTuplet = firstNote.NoteTuplet;
                                                              Severity: Major
                                                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                        if (octaveShift.OctaveShiftStart) {
                                                                                            targetOctaveShift = octaveShift.OctaveShiftStart;
                                                                                        } else if (octaveShift.OctaveShiftEnd) {
                                                                                            targetOctaveShift = octaveShift.OctaveShiftEnd;
                                                                                        }
                                                                Severity: Major
                                                                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                          for (let idx6: number = 0, len6: number = graphicalStaffEntry.sourceStaffEntry.VoiceEntries.length; idx6 < len6; ++idx6) {
                                                                                              const voiceEntry: VoiceEntry = graphicalStaffEntry.sourceStaffEntry.VoiceEntries[idx6];
                                                                                              if (voiceEntry.OrnamentContainer) {
                                                                                                  if (voiceEntry.hasTie() && !graphicalStaffEntry.relInMeasureTimestamp.Equals(voiceEntry.Timestamp)) {
                                                                                                      continue;
                                                                  Severity: Major
                                                                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            for (const voiceEntry of gse.graphicalVoiceEntries) {
                                                                                                if (voiceEntry.parentVoiceEntry.IsGrace) {
                                                                                                    continue;
                                                                                                }
                                                                                                // Sibelius: can have multiple fingerings per note, so we need to check voice entry instructions, not note.Fingering
                                                                    Severity: Major
                                                                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                              if (!staffEntry.graphicalChordContainers || staffEntry.graphicalChordContainers.length === 0) {
                                                                                                  continue;
                                                                                              }
                                                                      Severity: Major
                                                                      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                                if (!typeLength) {
                                                                                                    // shouldn't happen, now that rest notes have TypeLength set too, see VoiceGenerator.addRestNote(), addSingleNote()
                                                                                                    //   see test_tuplets_starting_with_rests_layout.mxl (first measure bass)
                                                                                                    log.warn("note missing TypeLength");
                                                                                                    typeLength = firstNote.NoteTuplet.Fractions[0];
                                                                        Severity: Major
                                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                                  if (consecutiveTupletCount <= this.rules.TupletNumberMaxConsecutiveRepetitions) {
                                                                                                      firstNote.NoteTuplet.RenderTupletNumber = true; // need to re-activate after re-render when it was set to false
                                                                                                  }
                                                                          Severity: Major
                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                    if (placement === PlacementEnum.Below) {
                                                                                                        fingerings.reverse();
                                                                                                    }
                                                                            Severity: Major
                                                                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                  if (startVerticalContainer) {
                                                                                                      // withinCrossedBeam = this.areStaffEntriesWithinCrossedBeam(startVerticalContainer,
                                                                                                      // endVerticalContainer, currentStaffLineIndex, formerStaffLineIndex);
                                                                                                  }
                                                                              Severity: Major
                                                                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                        if ((entry.Expression as InstantaneousTempoExpression).Enum === TempoEnum.metronomeMark) {
                                                                                                            this.createMetronomeMark((entry.Expression as InstantaneousTempoExpression));
                                                                                                            continue;
                                                                                                        }
                                                                                Severity: Major
                                                                                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                          for (const graphicalTie of staffEntry.GraphicalTies) {
                                                                                                              if (graphicalTie.StartNote !== undefined && graphicalTie.StartNote.parentVoiceEntry.parentStaffEntry === staffEntry) {
                                                                                                                  const tieIsAtSystemBreak: boolean = (
                                                                                                                      graphicalTie.StartNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine !==
                                                                                                                      graphicalTie.EndNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine
                                                                                  Severity: Major
                                                                                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                            if ((sourceMeasure.StaffLinkedExpressions[j][k].PedalStart)) {
                                                                                                                this.calculateSinglePedal(sourceMeasure, sourceMeasure.StaffLinkedExpressions[j][k], i, j);
                                                                                                            }
                                                                                    Severity: Major
                                                                                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                              if ((sourceMeasure.StaffLinkedExpressions[j][k].MoodList.length > 0) ||
                                                                                                                  (sourceMeasure.StaffLinkedExpressions[j][k].UnknownList.length > 0)) {
                                                                                                                  this.calculateMoodAndUnknownExpression(sourceMeasure.StaffLinkedExpressions[j][k], i, j);
                                                                                                              }
                                                                                      Severity: Major
                                                                                      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                                if (abstractNotationInstruction instanceof KeyInstruction) {
                                                                                                                    const keyInstruction: KeyInstruction = <KeyInstruction>abstractNotationInstruction;
                                                                                                                    accidentalCalculator.ActiveKeyInstruction = keyInstruction;
                                                                                                                }
                                                                                        Severity: Major
                                                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                                  for (const staffEntry of graphicalMeasure.staffEntries) {
                                                                                                                      for (const gve of staffEntry.graphicalVoiceEntries) {
                                                                                                                          gve.color();
                                                                                                                      }
                                                                                                                  }
                                                                                          Severity: Major
                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                                    if (consecutiveTupletCount > this.rules.TupletNumberMaxConsecutiveRepetitions) {
                                                                                                                        firstNote.NoteTuplet.RenderTupletNumber = false;
                                                                                                                        if (this.rules.TupletNumberAlwaysDisableAfterFirstMax) {
                                                                                                                            if (!disabledPerVoice[voice.VoiceId][currentTupletNumber]) {
                                                                                                                                disabledPerVoice[voice.VoiceId][currentTupletNumber] = {};
                                                                                            Severity: Major
                                                                                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                              Avoid deeply nested control flow statements.
                                                                                              Open

                                                                                                                  if (minSkyLineValueForExpressionLength < endIdealY) {
                                                                                                                      betweenIdealY = minSkyLineValueForExpressionLength;
                                                                                                                  }
                                                                                              Severity: Major
                                                                                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                        if (gse.graphicalVoiceEntries.length > 0 && gse.graphicalVoiceEntries[0].notes.length === 1) {
                                                                                                                            const graphicalNote: GraphicalNote = gse.graphicalVoiceEntries[0].notes[0];
                                                                                                                            if (!graphicalNote.sourceNote.Pitch && (new Fraction(1, 2)).lt(graphicalNote.sourceNote.Length)) {
                                                                                                                                this.layoutMeasureWithWholeRest(graphicalNote, gse, measure);
                                                                                                                            }
                                                                                                Severity: Major
                                                                                                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                          if (sourceMeasure.StaffLinkedExpressions[j][k].InstantaneousDynamic !== undefined ||
                                                                                                                              (sourceMeasure.StaffLinkedExpressions[j][k].StartingContinuousDynamic !== undefined &&
                                                                                                                                  sourceMeasure.StaffLinkedExpressions[j][k].StartingContinuousDynamic.StartMultiExpression ===
                                                                                                                                  sourceMeasure.StaffLinkedExpressions[j][k] && sourceMeasure.StaffLinkedExpressions[j][k].UnknownList.length === 0)
                                                                                                                          ) {
                                                                                                  Severity: Major
                                                                                                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                            if (!firstNote.NoteTuplet ||
                                                                                                                                firstNote.NoteTuplet.shouldBeBracketed(
                                                                                                                                    this.rules.TupletsBracketedUseXMLValue,
                                                                                                                                    this.rules.TupletsBracketed,
                                                                                                                                    this.rules.TripletsBracketed
                                                                                                    Severity: Major
                                                                                                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                              for (let i: number = 0; i < fingerings.length; i++) {
                                                                                                                                  const fingering: TechnicalInstruction = fingerings[i];
                                                                                                                                  const alignment: TextAlignmentEnum =
                                                                                                                                      placement === PlacementEnum.Above ? TextAlignmentEnum.CenterBottom : TextAlignmentEnum.CenterTop;
                                                                                                                                  const label: Label = new Label(fingering.value, alignment);
                                                                                                      Severity: Major
                                                                                                      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                if (targetOctaveShift?.ParentStartMultiExpression?.AbsoluteTimestamp.lte(sourceStaffEntry.AbsoluteTimestamp) &&
                                                                                                                                    !targetOctaveShift.ParentEndMultiExpression?.AbsoluteTimestamp.lt(sourceStaffEntry.AbsoluteTimestamp)) {
                                                                                                                                        octaveShiftValue = targetOctaveShift.Type;
                                                                                                                                        break;
                                                                                                                                    }
                                                                                                        Severity: Major
                                                                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                          Avoid deeply nested control flow statements.
                                                                                                          Open

                                                                                                                                  if ((sourceMeasure.StaffLinkedExpressions[j][k].OctaveShiftStart)) {
                                                                                                                                      this.calculateSingleOctaveShift(sourceMeasure, sourceMeasure.StaffLinkedExpressions[j][k], i, j);
                                                                                                                                  }
                                                                                                          Severity: Major
                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                            Avoid deeply nested control flow statements.
                                                                                                            Open

                                                                                                                                    for (let idx2: number = 0; idx2 < measureList[idx].length; idx2++) {
                                                                                                                                        measureList[idx][idx2] = undefined;
                                                                                                                                    }
                                                                                                            Severity: Major
                                                                                                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                              Avoid deeply nested control flow statements.
                                                                                                              Open

                                                                                                                                      if (firstNote.NoteTuplet.TupletLabelNumber !== currentTupletNumber ||
                                                                                                                                          !typeLength.Equals(currentTypeLength) ||
                                                                                                                                          firstNote.NoteTuplet.Bracket) {
                                                                                                                                          currentTupletNumber = firstNote.NoteTuplet.TupletLabelNumber;
                                                                                                                                          currentTypeLength = typeLength;
                                                                                                              Severity: Major
                                                                                                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                Open

                                                                                                                                    if (nextNote.sourceNote.NoteBeam !== undefined && previousNote.sourceNote.NoteBeam === nextNote.sourceNote.NoteBeam) {
                                                                                                                                        this.calculateRestNotePlacementWithinGraphicalBeam(
                                                                                                                                            graphicalStaffEntry, voice1Note1, previousNote,
                                                                                                                                            nextStaffEntry, nextNote
                                                                                                                                        );
                                                                                                                Severity: Major
                                                                                                                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                  Open

                                                                                                                                          for (let idx6: number = 0, len6: number = graphicalStaffEntry.sourceStaffEntry.VoiceEntries.length; idx6 < len6; ++idx6) {
                                                                                                                                              const voiceEntry: VoiceEntry = graphicalStaffEntry.sourceStaffEntry.VoiceEntries[idx6];
                                                                                                                                              if (voiceEntry.Articulations.length > 0) {
                                                                                                                                                  this.layoutArticulationMarks(voiceEntry.Articulations, voiceEntry, graphicalStaffEntry);
                                                                                                                                              }
                                                                                                                  Severity: Major
                                                                                                                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                    Open

                                                                                                                                            for (let i: number = 0; i < staffEntry.graphicalChordContainers.length; i++) {
                                                                                                                                                const graphicalChordContainer: GraphicalChordSymbolContainer = staffEntry.graphicalChordContainers[i];
                                                                                                                                                // check for chord not over a note
                                                                                                                                                if (staffEntry.graphicalVoiceEntries.length === 0 && staffEntry.relInMeasureTimestamp.RealValue > 0) {
                                                                                                                                                    // re-position (second chord symbol on whole measure rest)
                                                                                                                    Severity: Major
                                                                                                                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                      Open

                                                                                                                                              if (firstNote.NoteTuplet === skipTuplet) {
                                                                                                                                                  continue;
                                                                                                                                              }
                                                                                                                      Severity: Major
                                                                                                                      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                        Open

                                                                                                                                                if (this.rules.PercussionOneLineCutoff === -1 ||
                                                                                                                                                    MusicSheetCalculator.stafflineNoteCalculator.getStafflineUniquePositionCount(idx2) < this.rules.PercussionOneLineCutoff) {
                                                                                                                                                    measure.ParentStaff.StafflineCount = 1;
                                                                                                                                                }
                                                                                                                        Severity: Major
                                                                                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                          Open

                                                                                                                                              if (withinCrossedBeam) {
                                                                                                                                                  const formerStaffLine: StaffLine = musicSystem.StaffLines[formerStaffLineIndex];
                                                                                                                                                  const formerStaffLineMaxBottomLineValue: number = formerStaffLine.SkyBottomLineCalculator.
                                                                                                                                                                                                    getBottomLineMaxInRange(upperStartX, upperEndX);
                                                                                                                                                  const distanceBetweenStaffLines: number = staffLine.PositionAndShape.RelativePosition.y -
                                                                                                                          Severity: Major
                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                            Open

                                                                                                                                                for (const expr of staffLine.AbstractExpressions) {
                                                                                                                                                    if (expr instanceof GraphicalInstantaneousTempoExpression &&
                                                                                                                                                    (expr.SourceExpression as AbstractTempoExpression).Label === entry.Expression.Label) {
                                                                                                                                                        continue; // already added
                                                                                                                                                    }
                                                                                                                            Severity: Major
                                                                                                                            Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                              Open

                                                                                                                                                      if (graphicalMeasure.FirstInstructionStaffEntry) {
                                                                                                                                                          const index: number = graphicalMeasure.PositionAndShape.ChildElements.indexOf(
                                                                                                                                                              graphicalMeasure.FirstInstructionStaffEntry.PositionAndShape
                                                                                                                                                          );
                                                                                                                                                          if (index > -1) {
                                                                                                                              Severity: Major
                                                                                                                              Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                                Open

                                                                                                                                                        if (graphicalMeasure.LastInstructionStaffEntry) {
                                                                                                                                                            const index: number = graphicalMeasure.PositionAndShape.ChildElements.indexOf(
                                                                                                                                                                graphicalMeasure.LastInstructionStaffEntry.PositionAndShape
                                                                                                                                                            );
                                                                                                                                                            if (index > -1) {
                                                                                                                                Severity: Major
                                                                                                                                Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                  Open

                                                                                                                                                          if (startStaffEntry) {
                                                                                                                                                              startStaffEntry.GraphicalTies.clear(); // don't duplicate ties when calling render() again
                                                                                                                                                              startStaffEntry.ties.clear();
                                                                                                                                                          }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                    Open

                                                                                                                                                            for (let idx: number = 0, len: number = sourceStaffEntry.VoiceEntries.length; idx < len; ++idx) {
                                                                                                                                                                const voiceEntry: VoiceEntry = sourceStaffEntry.VoiceEntries[idx];
                                                                                                                                                                for (let idx2: number = 0, len2: number = voiceEntry.Notes.length; idx2 < len2; ++idx2) {
                                                                                                                                                                    const note: Note = voiceEntry.Notes[idx2];
                                                                                                                                                                    if (note.NoteTie) {
                                                                                                                                    Severity: Major
                                                                                                                                    Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                                      Open

                                                                                                                                                              if (relativeSkyLineHeight - this.rules.WedgeOpeningLength > this.rules.StaffHeight) {
                                                                                                                                                                  idealY = relativeSkyLineHeight - this.rules.WedgeVerticalMargin;
                                                                                                                                                              } else {
                                                                                                                                                                  idealY = this.rules.StaffHeight + this.rules.WedgeOpeningLength;
                                                                                                                                                              }
                                                                                                                                      Severity: Major
                                                                                                                                      Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                                        Open

                                                                                                                                                                if (expr instanceof GraphicalInstantaneousTempoExpression &&
                                                                                                                                                                    (expr.SourceExpression as AbstractTempoExpression).Label === entry.Expression.Label) {
                                                                                                                                                                    //already added
                                                                                                                                                                    continue;
                                                                                                                                                                }
                                                                                                                                        Severity: Major
                                                                                                                                        Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 45 mins to fix

                                                                                                                                          Function maxInstrNameLabelLength has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                              protected maxInstrNameLabelLength(): number {
                                                                                                                                                  let maxLabelLength: number = 0.0;
                                                                                                                                                  for (const instrument of this.graphicalMusicSheet.ParentMusicSheet.Instruments) {
                                                                                                                                                      if (instrument.NameLabel?.print && instrument.Voices.length > 0 && instrument.Voices[0].Visible) {
                                                                                                                                                          let renderedLabel: Label = instrument.NameLabel;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts - About 35 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 calculateAlignedChordSymbolsOffset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                              protected calculateAlignedChordSymbolsOffset(staffEntries: GraphicalStaffEntry[], sbc: SkyBottomLineCalculator): number {
                                                                                                                                                  let minimumOffset: number = Number.MAX_SAFE_INTEGER;
                                                                                                                                                  for (const staffEntry of staffEntries) {
                                                                                                                                                      for (const graphicalChordContainer of staffEntry.graphicalChordContainers) {
                                                                                                                                                          const gps: BoundingBox = graphicalChordContainer.PositionAndShape;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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

                                                                                                                                          Function calculateLabel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                              protected calculateLabel(staffLine: StaffLine,
                                                                                                                                                                       relative: PointF2D,
                                                                                                                                                                       combinedString: string,
                                                                                                                                                                       style: FontStyles,
                                                                                                                                                                       placement: PlacementEnum,
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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

                                                                                                                                          Function layoutVoiceEntries has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                              protected layoutVoiceEntries(graphicalStaffEntry: GraphicalStaffEntry, staffIndex: number): void {
                                                                                                                                                  graphicalStaffEntry.PositionAndShape.RelativePosition = new PointF2D(0.0, 0.0);
                                                                                                                                                  if (!this.leadSheet) {
                                                                                                                                                      for (const gve of graphicalStaffEntry.graphicalVoiceEntries) {
                                                                                                                                                          const graphicalNotes: GraphicalNote[] = gve.notes;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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

                                                                                                                                          Function calculateDashes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                              private calculateDashes(staffLine: StaffLine, startX: number, endX: number, y: number): void {
                                                                                                                                                  let distance: number = endX - startX;
                                                                                                                                                  if (distance < this.rules.MinimumDistanceBetweenDashes * 3) {
                                                                                                                                                      this.calculateSingleDashForLyricWord(staffLine, startX, endX, y);
                                                                                                                                                  } else {
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.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

                                                                                                                                              private calculateOctaveShifts(): void {
                                                                                                                                                  for (let i: number = 0; i < this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length; i++) {
                                                                                                                                                      const sourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[i];
                                                                                                                                                      for (let j: number = 0; j < sourceMeasure.StaffLinkedExpressions.length; j++) {
                                                                                                                                                          if (!this.graphicalMusicSheet.MeasureList[i] || !this.graphicalMusicSheet.MeasureList[i][j]) {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 1 day to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3611..3627

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

                                                                                                                                          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

                                                                                                                                              private calculatePedals(): void {
                                                                                                                                                  for (let i: number = 0; i < this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length; i++) {
                                                                                                                                                      const sourceMeasure: SourceMeasure = this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures[i];
                                                                                                                                                      for (let j: number = 0; j < sourceMeasure.StaffLinkedExpressions.length; j++) {
                                                                                                                                                          if (!this.graphicalMusicSheet.MeasureList[i] || !this.graphicalMusicSheet.MeasureList[i][j]) {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 1 day to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3593..3609

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

                                                                                                                                          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 (musicSheet.Copyright !== undefined && this.rules.RenderCopyright) {
                                                                                                                                                      const copyright: GraphicalLabel = new GraphicalLabel(
                                                                                                                                                          musicSheet.Copyright, this.rules.SheetCopyrightHeight, TextAlignmentEnum.CenterBottom, this.rules);
                                                                                                                                                          copyright.Label.IsCreditLabel = true;
                                                                                                                                                          copyright.Label.colorDefault = defaultColorTitle;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 3 other locations - About 6 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2204..2213
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2214..2223
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2224..2233

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

                                                                                                                                          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 (musicSheet.Subtitle !== undefined && this.rules.RenderSubtitle) {
                                                                                                                                                      const subtitle: GraphicalLabel = new GraphicalLabel(
                                                                                                                                                          musicSheet.Subtitle, this.rules.SheetSubtitleHeight, TextAlignmentEnum.CenterCenter, this.rules);
                                                                                                                                                      subtitle.Label.IsCreditLabel = true;
                                                                                                                                                      subtitle.Label.colorDefault = defaultColorTitle;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 3 other locations - About 6 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2214..2223
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2224..2233
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2234..2243

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

                                                                                                                                          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 (musicSheet.Composer !== undefined && this.rules.RenderComposer) {
                                                                                                                                                      const composer: GraphicalLabel = new GraphicalLabel(
                                                                                                                                                          musicSheet.Composer, this.rules.SheetComposerHeight, TextAlignmentEnum.RightCenter, this.rules);
                                                                                                                                                      composer.Label.IsCreditLabel = true;
                                                                                                                                                      composer.Label.colorDefault = defaultColorTitle;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 3 other locations - About 6 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2204..2213
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2224..2233
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2234..2243

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

                                                                                                                                          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 (musicSheet.Lyricist !== undefined && this.rules.RenderLyricist) {
                                                                                                                                                      const lyricist: GraphicalLabel = new GraphicalLabel(
                                                                                                                                                          musicSheet.Lyricist, this.rules.SheetAuthorHeight, TextAlignmentEnum.LeftCenter, this.rules);
                                                                                                                                                      lyricist.Label.IsCreditLabel = true;
                                                                                                                                                      lyricist.Label.colorDefault = defaultColorTitle;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 3 other locations - About 6 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2204..2213
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2214..2223
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2234..2243

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

                                                                                                                                          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 (graphicalMeasure.LastInstructionStaffEntry) {
                                                                                                                                                                      const index: number = graphicalMeasure.PositionAndShape.ChildElements.indexOf(
                                                                                                                                                                          graphicalMeasure.LastInstructionStaffEntry.PositionAndShape
                                                                                                                                                                      );
                                                                                                                                                                      if (index > -1) {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 3 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2027..2036

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

                                                                                                                                          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 idx2: number = 0, len2: number = this.musicSystems.length; idx2 < len2; ++idx2) {
                                                                                                                                                      const musicSystem: MusicSystem = this.musicSystems[idx2];
                                                                                                                                                      for (let idx3: number = 0, len3: number = musicSystem.StaffLines.length; idx3 < len3; ++idx3) {
                                                                                                                                                          const staffLine: StaffLine = musicSystem.StaffLines[idx3];
                                                                                                                                                          this.updateStaffLineBorders(staffLine);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 3 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3667..3673

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

                                                                                                                                          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

                                                                                                                                              private calculateRepetitionEndings(): void {
                                                                                                                                                  const musicsheet: MusicSheet = this.graphicalMusicSheet.ParentMusicSheet;
                                                                                                                                                  for (let idx: number = 0, len: number = musicsheet.Repetitions.length; idx < len; ++idx) {
                                                                                                                                                      const repetition: Repetition = musicsheet.Repetitions[idx];
                                                                                                                                                      this.calcGraphicalRepetitionEndingsRecursively(repetition);
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 3 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 983..989

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

                                                                                                                                          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 (graphicalMeasure.FirstInstructionStaffEntry) {
                                                                                                                                                                      const index: number = graphicalMeasure.PositionAndShape.ChildElements.indexOf(
                                                                                                                                                                          graphicalMeasure.FirstInstructionStaffEntry.PositionAndShape
                                                                                                                                                                      );
                                                                                                                                                                      if (index > -1) {
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 3 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2037..2046

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

                                                                                                                                          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.rules.RenderMeasureNumbers) {
                                                                                                                                                      for (let idx: number = 0, len: number = this.musicSystems.length; idx < len; ++idx) {
                                                                                                                                                          const musicSystem: MusicSystem = this.musicSystems[idx];
                                                                                                                                                          this.calculateMeasureNumberPlacement(musicSystem);
                                                                                                                                                      }
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 2 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 941..946

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

                                                                                                                                          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.rules.RenderMeasureNumbers) {
                                                                                                                                                      for (let idx: number = 0, len: number = this.musicSystems.length; idx < len; ++idx) {
                                                                                                                                                          const musicSystem: MusicSystem = this.musicSystems[idx];
                                                                                                                                                          this.calculateMeasureNumberSkyline(musicSystem);
                                                                                                                                                      }
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 2 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 926..931

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

                                                                                                                                          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

                                                                                                                                                      for (let idx: number = 0, len: number = sourceMeasure.FirstRepetitionInstructions.length; idx < len; ++idx) {
                                                                                                                                                          const instruction: RepetitionInstruction = sourceMeasure.FirstRepetitionInstructions[idx];
                                                                                                                                                          this.calculateWordRepetitionInstruction(instruction, i);
                                                                                                                                                      }
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 2 other locations - About 2 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3166..3169
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3660..3663

                                                                                                                                          Duplicated Code

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

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

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

                                                                                                                                          Tuning

                                                                                                                                          This issue has a mass of 77.

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

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

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

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

                                                                                                                                          Refactorings

                                                                                                                                          Further Reading

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

                                                                                                                                                      for (let idx: number = 0, len: number = sourceMeasure.LastRepetitionInstructions.length; idx < len; ++idx) {
                                                                                                                                                          const instruction: RepetitionInstruction = sourceMeasure.LastRepetitionInstructions[idx];
                                                                                                                                                          this.calculateWordRepetitionInstruction(instruction, i);
                                                                                                                                                      }
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 2 other locations - About 2 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3166..3169
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3656..3659

                                                                                                                                          Duplicated Code

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

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

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

                                                                                                                                          Tuning

                                                                                                                                          This issue has a mass of 77.

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

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

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

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

                                                                                                                                          Refactorings

                                                                                                                                          Further Reading

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

                                                                                                                                                              for (let idx5: number = 0, len5: number = measure.staffEntries.length; idx5 < len5; ++idx5) {
                                                                                                                                                                  const graphicalStaffEntry: GraphicalStaffEntry = measure.staffEntries[idx5];
                                                                                                                                                                  this.optimizeRestNotePlacement(graphicalStaffEntry, measure);
                                                                                                                                                              }
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 2 other locations - About 2 hrs to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3656..3659
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3660..3663

                                                                                                                                          Duplicated Code

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

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

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

                                                                                                                                          Tuning

                                                                                                                                          This issue has a mass of 77.

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

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

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

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

                                                                                                                                          Refactorings

                                                                                                                                          Further Reading

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

                                                                                                                                                      const endX: number = endStaffentry.parentMeasure.PositionAndShape.RelativePosition.x +
                                                                                                                                                          endStaffentry.PositionAndShape.RelativePosition.x +
                                                                                                                                                          lyricEntry.GraphicalLabel.PositionAndShape.RelativePosition.x +
                                                                                                                                                          nextLyricEntry.GraphicalLabel.PositionAndShape.BorderMarginLeft;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 1 hr to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3307..3310

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

                                                                                                                                          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 startX: number = startStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x +
                                                                                                                                                          startStaffEntry.PositionAndShape.RelativePosition.x +
                                                                                                                                                          lyricEntry.GraphicalLabel.PositionAndShape.RelativePosition.x +
                                                                                                                                                          lyricEntry.GraphicalLabel.PositionAndShape.BorderMarginRight -
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 1 hr to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3313..3316

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

                                                                                                                                          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 startX: number = startStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x +
                                                                                                                                                          startStaffEntry.PositionAndShape.RelativePosition.x +
                                                                                                                                                          lyricEntry.GraphicalLabel.PositionAndShape.BorderMarginRight;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 1 hr to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3353..3355

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

                                                                                                                                          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 secondEndX: number = endStaffentry.parentMeasure.PositionAndShape.RelativePosition.x +
                                                                                                                                                              endStaffentry.PositionAndShape.RelativePosition.x +
                                                                                                                                                              nextLyricEntry.GraphicalLabel.PositionAndShape.BorderMarginLeft;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 1 hr to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3486..3488

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

                                                                                                                                          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

                                                                                                                                              protected handleTiedGraphicalNote(tiedGraphicalNote: GraphicalNote, beams: Beam[], activeClef: ClefInstruction,
                                                                                                                                                                                octaveShiftValue: OctaveEnum, graphicalStaffEntry: GraphicalStaffEntry, duration: Fraction,
                                                                                                                                                                                openTie: Tie, isLastTieNote: boolean): void {
                                                                                                                                                  throw new Error(this.abstractNotImplementedErrorMessage);
                                                                                                                                              }
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 1 hr to fix
                                                                                                                                          src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts on lines 1553..1557

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

                                                                                                                                          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

                                                                                                                                                  for (let i: number = horizontalIndex + 1; i < this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers.length; i++) {
                                                                                                                                                      if (this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[verticalIndex]) {
                                                                                                                                                          return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[verticalIndex];
                                                                                                                                                      }
                                                                                                                                                  }
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3633..3637

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

                                                                                                                                          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

                                                                                                                                                  for (let i: number = horizontalIndex - 1; i >= 0; i--) {
                                                                                                                                                      if (this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[verticalIndex]) {
                                                                                                                                                          return this.graphicalMusicSheet.VerticalGraphicalStaffEntryContainers[i].StaffEntries[verticalIndex];
                                                                                                                                                      }
                                                                                                                                                  }
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3645..3649

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

                                                                                                                                          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 endX: number = endStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x +
                                                                                                                                                          endStaffEntry.PositionAndShape.RelativePosition.x +
                                                                                                                                                          endStaffEntry.PositionAndShape.BorderMarginRight;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3503..3505

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

                                                                                                                                          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 secondEndX: number = endStaffEntry.parentMeasure.PositionAndShape.RelativePosition.x +
                                                                                                                                                              endStaffEntry.PositionAndShape.RelativePosition.x +
                                                                                                                                                              endStaffEntry.PositionAndShape.BorderMarginRight;
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3472..3474

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

                                                                                                                                          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

                                                                                                                                                          const distanceBetweenStaffLines: number = staffLine.PositionAndShape.RelativePosition.y -
                                                                                                                                                              previousStaffLine.PositionAndShape.RelativePosition.y -
                                                                                                                                                              this.rules.StaffHeight;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 2 other locations - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 1529..1531
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 1778..1779

                                                                                                                                          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

                                                                                                                                                          for (let idx: number = 0, len: number = sourceStaffEntry.Instructions.length; idx < len; ++idx) {
                                                                                                                                                              const abstractNotationInstruction: AbstractNotationInstruction = sourceStaffEntry.Instructions[idx];
                                                                                                                                                              if (abstractNotationInstruction instanceof ClefInstruction) {
                                                                                                                                                                  activeClefs[staffIndex] = <ClefInstruction>abstractNotationInstruction;
                                                                                                                                                              }
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2859..2864

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

                                                                                                                                                          const distanceBetweenStaffLines: number = nextStaffLine.PositionAndShape.RelativePosition.y -
                                                                                                                                                              staffLine.PositionAndShape.RelativePosition.y -
                                                                                                                                                              this.rules.StaffHeight;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 2 other locations - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 1622..1624
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 1778..1779

                                                                                                                                          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

                                                                                                                                                      for (let idx: number = 0, len: number = lastStaffEntry.Instructions.length; idx < len; ++idx) {
                                                                                                                                                          const abstractNotationInstruction: AbstractNotationInstruction = lastStaffEntry.Instructions[idx];
                                                                                                                                                          if (abstractNotationInstruction instanceof ClefInstruction) {
                                                                                                                                                              activeClefs[staffIndex] = <ClefInstruction>abstractNotationInstruction;
                                                                                                                                                          }
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 2783..2788

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

                                                                                                                                                          const difference: number = staffLine.PositionAndShape.RelativePosition.y -
                                                                                                                                                              formerStaffLine.PositionAndShape.RelativePosition.y - this.rules.StaffHeight;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 2 other locations - About 55 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 1529..1531
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 1622..1624

                                                                                                                                          Duplicated Code

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

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

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

                                                                                                                                          Tuning

                                                                                                                                          This issue has a mass of 53.

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

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

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

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

                                                                                                                                          Refactorings

                                                                                                                                          Further Reading

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

                                                                                                                                                  const maxIndex: number = Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length - 1, this.rules.MaxMeasureToDrawIndex);
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 40 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3676..3676

                                                                                                                                          Duplicated Code

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

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

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

                                                                                                                                          Tuning

                                                                                                                                          This issue has a mass of 48.

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

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

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

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

                                                                                                                                          Refactorings

                                                                                                                                          Further Reading

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

                                                                                                                                                  const maxIndex: number = Math.min(this.graphicalMusicSheet.ParentMusicSheet.SourceMeasures.length - 1, this.rules.MaxMeasureToDrawIndex);
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 40 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3566..3566

                                                                                                                                          Duplicated Code

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

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

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

                                                                                                                                          Tuning

                                                                                                                                          This issue has a mass of 48.

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

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

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

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

                                                                                                                                          Refactorings

                                                                                                                                          Further Reading

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

                                                                                                                                                      if (nextStaffLine && // check for undefined objects e.g. when drawingRange given
                                                                                                                                                          nextStaffLine.Measures[0] &&
                                                                                                                                                          endStaffentry.parentMeasure.ParentStaffLine &&
                                                                                                                                                          !(endStaffentry === endStaffentry.parentMeasure.staffEntries[0] &&
                                                                                                                                                          endStaffentry.parentMeasure === endStaffentry.parentMeasure.ParentStaffLine.Measures[0])) {
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 40 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3499..3501

                                                                                                                                          Duplicated Code

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

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

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

                                                                                                                                          Tuning

                                                                                                                                          This issue has a mass of 48.

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

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

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

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

                                                                                                                                          Refactorings

                                                                                                                                          Further Reading

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

                                                                                                                                                      if (endStaffEntry.parentMeasure.ParentStaffLine && endStaffEntry.parentMeasure.staffEntries &&
                                                                                                                                                          !(endStaffEntry === endStaffEntry.parentMeasure.staffEntries[0] &&
                                                                                                                                                          endStaffEntry.parentMeasure === endStaffEntry.parentMeasure.ParentStaffLine.Measures[0])) {
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 40 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 3347..3351

                                                                                                                                          Duplicated Code

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

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

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

                                                                                                                                          Tuning

                                                                                                                                          This issue has a mass of 48.

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

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

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

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

                                                                                                                                          Refactorings

                                                                                                                                          Further Reading

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

                                                                                                                                              protected handleTuplet(graphicalNote: GraphicalNote, tuplet: Tuplet, openTuplets: Tuplet[]): void {
                                                                                                                                                  throw new Error(this.abstractNotImplementedErrorMessage);
                                                                                                                                              }
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 35 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 408..411

                                                                                                                                          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

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

                                                                                                                                              protected handleVoiceEntryLyrics(voiceEntry: VoiceEntry, graphicalStaffEntry: GraphicalStaffEntry,
                                                                                                                                                                               openLyricWords: LyricWord[]): void {
                                                                                                                                                  throw new Error(this.abstractNotImplementedErrorMessage);
                                                                                                                                              }
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 35 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 436..438

                                                                                                                                          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

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

                                                                                                                                                          const formerStaffLine: StaffLine = staffLine.ParentMusicSystem.StaffLines[staffLine.ParentMusicSystem.StaffLines.indexOf(staffLine) - 1];
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 30 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 1797..1797

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

                                                                                                                                          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

                                                                                                                                                                              graphicalTie.StartNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine !==
                                                                                                                                                                              graphicalTie.EndNote.parentVoiceEntry.parentStaffEntry.parentMeasure.ParentStaffLine
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 30 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/VexFlow/VexFlowMusicSheetCalculator.ts on lines 1310..1311

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

                                                                                                                                          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 nextStaffLine: StaffLine = staffLine.ParentMusicSystem.StaffLines[staffLine.ParentMusicSystem.StaffLines.indexOf(staffLine) + 1];
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in src/MusicalScore/Graphical/MusicSheetCalculator.ts and 1 other location - About 30 mins to fix
                                                                                                                                          src/MusicalScore/Graphical/MusicSheetCalculator.ts on lines 1777..1777

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

                                                                                                                                          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