opensheetmusicdisplay/opensheetmusicdisplay

View on GitHub
src/MusicalScore/MusicParts/MusicPartManagerIterator.ts

Summary

Maintainability
F
1 wk
Test Coverage

File MusicPartManagerIterator.ts has 552 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {Fraction} from "../../Common/DataObjects/Fraction";
import {Repetition} from "../MusicSource/Repetition";
import {DynamicsContainer} from "../VoiceData/HelperObjects/DynamicsContainer";
import {MappingSourceMusicPart} from "../MusicSource/MappingSourceMusicPart";
import {SourceMeasure} from "../VoiceData/SourceMeasure";
Severity: Major
Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 1 day to fix

    MusicPartManagerIterator has 43 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class MusicPartManagerIterator {
        constructor(musicSheet: MusicSheet, startTimestamp?: Fraction, endTimestamp?: Fraction) {
            try {
                this.frontReached = true;
                this.musicSheet = musicSheet;
    Severity: Minor
    Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 5 hrs to fix

      Function activateCurrentDynamicOrTempoInstructions has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          private activateCurrentDynamicOrTempoInstructions(): void {
              const timeSortedDynamics: DynamicsContainer[] = this.musicSheet.TimestampSortedDynamicExpressionsList;
              while (
                this.currentDynamicEntryIndex > 0 && (
                  this.currentDynamicEntryIndex >= timeSortedDynamics.length ||
      Severity: Minor
      Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 activateCurrentDynamicOrTempoInstructions has 82 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private activateCurrentDynamicOrTempoInstructions(): void {
              const timeSortedDynamics: DynamicsContainer[] = this.musicSheet.TimestampSortedDynamicExpressionsList;
              while (
                this.currentDynamicEntryIndex > 0 && (
                  this.currentDynamicEntryIndex >= timeSortedDynamics.length ||
      Severity: Major
      Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 3 hrs to fix

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

            private handleRepetitionsAtMeasureEnd(): void {
                for (let idx: number = 0, len: number = this.currentMeasure.LastRepetitionInstructions.length; idx < len; ++idx) {
                    const repetitionInstruction: RepetitionInstruction = this.currentMeasure.LastRepetitionInstructions[idx];
                    const currentRepetition: Repetition = repetitionInstruction.parentRepetition;
                    if (!currentRepetition) { continue; }
        Severity: Minor
        Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 handleRepetitionsAtMeasureEnd has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private handleRepetitionsAtMeasureEnd(): void {
                for (let idx: number = 0, len: number = this.currentMeasure.LastRepetitionInstructions.length; idx < len; ++idx) {
                    const repetitionInstruction: RepetitionInstruction = this.currentMeasure.LastRepetitionInstructions[idx];
                    const currentRepetition: Repetition = repetitionInstruction.parentRepetition;
                    if (!currentRepetition) { continue; }
        Severity: Minor
        Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 1 hr to fix

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

              constructor(musicSheet: MusicSheet, startTimestamp?: Fraction, endTimestamp?: Fraction) {
                  try {
                      this.frontReached = true;
                      this.musicSheet = musicSheet;
                      this.currentVoiceEntries = undefined;
          Severity: Minor
          Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 recursiveMoveBack has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private recursiveMoveBack(): void {
                 if (this.currentVoiceEntryIndex > 0 ) {
                      this.currentVoiceEntryIndex--;
                      const currentContainer: VerticalSourceStaffEntryContainer = this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];
                      this.currentVoiceEntries = this.getVoiceEntries(currentContainer);
          Severity: Minor
          Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 1 hr to fix

            Function constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                constructor(musicSheet: MusicSheet, startTimestamp?: Fraction, endTimestamp?: Fraction) {
                    try {
                        this.frontReached = true;
                        this.musicSheet = musicSheet;
                        this.currentVoiceEntries = undefined;
            Severity: Minor
            Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 1 hr to fix

              Function recursiveMove has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private recursiveMove(): void {
                      this.currentVoiceEntryIndex++; // TODO handle hidden part: skip hidden voice if requested by parameter
                      if (this.currentVoiceEntryIndex === 0) {
                          this.handleRepetitionsAtMeasureBegin();
                          this.activateCurrentRhythmInstructions();
              Severity: Minor
              Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 1 hr to fix

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

                    public CurrentVisibleVoiceEntries(instrument?: Instrument): VoiceEntry[] {
                        const voiceEntries: VoiceEntry[] = [];
                        if (!this.currentVoiceEntries) {
                            return voiceEntries;
                        }
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 CurrentAudibleVoiceEntries has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public CurrentAudibleVoiceEntries(instrument?: Instrument): VoiceEntry[] {
                        const voiceEntries: VoiceEntry[] = [];
                        if (!this.currentVoiceEntries) {
                            return voiceEntries;
                        }
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 CurrentScoreFollowingVoiceEntries has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public CurrentScoreFollowingVoiceEntries(instrument?: Instrument): VoiceEntry[] {
                        const voiceEntries: VoiceEntry[] = [];
                        if (!this.currentVoiceEntries) {
                            return voiceEntries;
                        }
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 handleRepetitionsAtMeasureBegin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    private handleRepetitionsAtMeasureBegin(): void {
                        for (let idx: number = 0, len: number = this.currentMeasure.FirstRepetitionInstructions.length; idx < len; ++idx) {
                            const repetitionInstruction: RepetitionInstruction = this.currentMeasure.FirstRepetitionInstructions[idx];
                            if (!repetitionInstruction.parentRepetition) { continue; }
                            const currentRepetition: Repetition = repetitionInstruction.parentRepetition;
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 getVisibleEntries has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    private getVisibleEntries(entry: VoiceEntry, visibleEntries: VoiceEntry[]): void {
                        if (entry.ParentVoice.Visible) {
                            let anyNoteVisible: boolean = false;
                            for (const note of entry.Notes) {
                                if (note.PrintObject) {
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 45 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function checkEntries has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    private checkEntries(notesOnly: boolean): boolean {
                        const tlist: VoiceEntry[] = this.CurrentVisibleVoiceEntries();
                        if (tlist.length > 0) {
                            if (!notesOnly) { return true; }
                            for (let idx: number = 0, len: number = tlist.length; idx < len; ++idx) {
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts - About 45 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                    private recursiveMoveBack(): void {
                       if (this.currentVoiceEntryIndex > 0 ) {
                            this.currentVoiceEntryIndex--;
                            const currentContainer: VerticalSourceStaffEntryContainer = this.currentMeasure.VerticalSourceStaffEntryContainers[this.currentVoiceEntryIndex];
                            this.currentVoiceEntries = this.getVoiceEntries(currentContainer);
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 activateCurrentRhythmInstructions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private activateCurrentRhythmInstructions(): void {
                        if (
                          this.currentMeasure !== undefined &&
                          this.currentMeasure.FirstInstructionsStaffEntries.length > 0 &&
                          this.currentMeasure.FirstInstructionsStaffEntries[0] !== undefined
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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 recursiveMove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private recursiveMove(): void {
                        this.currentVoiceEntryIndex++; // TODO handle hidden part: skip hidden voice if requested by parameter
                        if (this.currentVoiceEntryIndex === 0) {
                            this.handleRepetitionsAtMeasureBegin();
                            this.activateCurrentRhythmInstructions();
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.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

                    public CurrentAudibleVoiceEntries(instrument?: Instrument): VoiceEntry[] {
                        const voiceEntries: VoiceEntry[] = [];
                        if (!this.currentVoiceEntries) {
                            return voiceEntries;
                        }
                Severity: Major
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 6 hrs to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 162..180

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 161.

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

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

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

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

                Refactorings

                Further Reading

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

                    public CurrentVisibleVoiceEntries(instrument?: Instrument): VoiceEntry[] {
                        const voiceEntries: VoiceEntry[] = [];
                        if (!this.currentVoiceEntries) {
                            return voiceEntries;
                        }
                Severity: Major
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 6 hrs to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 187..205

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

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

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

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

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

                Refactorings

                Further Reading

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

                                if (
                                  this.JumpResponsibleRepetition !== undefined
                                  && currentRepetition !== this.JumpResponsibleRepetition
                                  && currentRepetition.StartIndex >= this.JumpResponsibleRepetition.StartIndex
                                  && currentRepetition.EndIndex <= this.JumpResponsibleRepetition.EndIndex
                Severity: Major
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 2 hrs to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 365..372

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

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

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

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

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

                Refactorings

                Further Reading

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

                                if (
                                  this.JumpResponsibleRepetition !== undefined &&
                                  currentRepetition !== this.JumpResponsibleRepetition &&
                                  currentRepetition.StartIndex >= this.JumpResponsibleRepetition.StartIndex &&
                                  currentRepetition.EndIndex <= this.JumpResponsibleRepetition.EndIndex
                Severity: Major
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 2 hrs to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 390..397

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

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

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

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

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

                Refactorings

                Further Reading

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

                    public moveToNextVisibleVoiceEntry(notesOnly: boolean): void {
                        while (!this.endReached) {
                            this.moveToNext();
                            if (this.checkEntries(notesOnly)) { return; }
                        }
                Severity: Major
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 1 hr to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 257..264

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

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

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

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

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

                Refactorings

                Further Reading

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

                    public moveToPreviousVisibleVoiceEntry(notesOnly: boolean): void {
                        while (!this.frontReached) {
                            this.moveToPrevious();
                            if (this.checkEntries(notesOnly)) {
                                return;
                Severity: Major
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 1 hr to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 281..286

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

                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.activeDynamicExpressions[staffIndex] instanceof ContinuousDynamicExpression) {
                                        const continuousDynamic: ContinuousDynamicExpression =
                                            <ContinuousDynamicExpression>this.activeDynamicExpressions[staffIndex];
                                        this.currentDynamicChangingExpressions.push(new DynamicsContainer(continuousDynamic, staffIndex));
                                    } else {
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 45 mins to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 41..45

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 50.

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

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

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

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

                Refactorings

                Further Reading

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

                                    } else {
                                        const instantaneousDynamic: InstantaneousDynamicExpression =
                                            <InstantaneousDynamicExpression>this.activeDynamicExpressions[staffIndex];
                                        this.currentDynamicChangingExpressions.push(new DynamicsContainer(instantaneousDynamic, staffIndex));
                                    }
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 45 mins to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 37..41

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 50.

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

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

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

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

                Refactorings

                Further Reading

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

                        while (
                          this.currentDynamicEntryIndex < timeSortedDynamics.length &&
                          timeSortedDynamics[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.lt(this.CurrentSourceTimestamp)
                        ) {
                            this.currentDynamicEntryIndex++;
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 40 mins to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 458..472

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 49.

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

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

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

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

                Refactorings

                Further Reading

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

                        while (
                          this.currentDynamicEntryIndex < timeSortedDynamics.length
                          && timeSortedDynamics[this.currentDynamicEntryIndex].parMultiExpression().AbsoluteTimestamp.Equals(this.CurrentSourceTimestamp)
                        ) {
                            const dynamicsContainer: DynamicsContainer = timeSortedDynamics[this.currentDynamicEntryIndex];
                Severity: Minor
                Found in src/MusicalScore/MusicParts/MusicPartManagerIterator.ts and 1 other location - About 40 mins to fix
                src/MusicalScore/MusicParts/MusicPartManagerIterator.ts on lines 452..457

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 49.

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

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

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

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

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status