opensheetmusicdisplay/opensheetmusicdisplay

View on GitHub
src/MusicalScore/ScoreIO/MusicSheetReader.ts

Summary

Maintainability
F
2 wks
Test Coverage

Function createInstrumentGroups has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
Open

    private createInstrumentGroups(entryList: IXmlElement[]): { [_: string]: Instrument } {
        let instrumentId: number = 0;
        const instrumentDict: { [_: string]: Instrument } = {};
        let currentGroup: InstrumentalGroup;
        try {
Severity: Minor
Found in src/MusicalScore/ScoreIO/MusicSheetReader.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

File MusicSheetReader.ts has 917 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {MusicSheet} from "../MusicSheet";
import {SourceMeasure} from "../VoiceData/SourceMeasure";
import {Fraction} from "../../Common/DataObjects/Fraction";
import {InstrumentReader} from "./InstrumentReader";
import {IXmlElement} from "../../Common/FileIO/Xml";
Severity: Major
Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 2 days to fix

    Function readTitleAndComposerFromCreditsLegacy has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
    Open

        private readTitleAndComposerFromCreditsLegacy(root: IXmlElement): void {
            const systemYCoordinates: number = this.computeSystemYCoordinates(root);
            if (systemYCoordinates === 0) {
                return;
            }
    Severity: Minor
    Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 readTitleAndComposerFromCredits has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

        private readTitleAndComposerFromCredits(root: IXmlElement): void {
            if (this.rules.SheetComposerSubtitleUseLegacyParsing) {
                this.readTitleAndComposerFromCreditsLegacy(root);
                return;
            }
    Severity: Minor
    Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 checkIfRhythmInstructionsAreSetAndEqual has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        private checkIfRhythmInstructionsAreSetAndEqual(instrumentReaders: InstrumentReader[]): void {
            const rhythmInstructions: RhythmInstruction[] = [];
            for (let i: number = 0; i < this.completeNumberOfStaves; i++) {
                if (this.currentMeasure.FirstInstructionsStaffEntries[i]) {
                    const last: AbstractNotationInstruction = this.currentMeasure.FirstInstructionsStaffEntries[i].Instructions[
    Severity: Minor
    Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 createInstrumentGroups has 132 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private createInstrumentGroups(entryList: IXmlElement[]): { [_: string]: Instrument } {
            let instrumentId: number = 0;
            const instrumentDict: { [_: string]: Instrument } = {};
            let currentGroup: InstrumentalGroup;
            try {
    Severity: Major
    Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 5 hrs to fix

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

          private checkSourceMeasureForNullEntries(): void {
              for (let i: number = this.currentMeasure.VerticalSourceStaffEntryContainers.length - 1; i >= 0; i--) {
                  for (let j: number = this.currentMeasure.VerticalSourceStaffEntryContainers[i].StaffEntries.length - 1; j >= 0; j--) {
                      const sourceStaffEntry: SourceStaffEntry = this.currentMeasure.VerticalSourceStaffEntryContainers[i].StaffEntries[j];
                      if (sourceStaffEntry) {
      Severity: Minor
      Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 _createMusicSheet has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          private _createMusicSheet(root: IXmlElement, path: string): MusicSheet {
              const instrumentReaders: InstrumentReader[] = [];
              let sourceMeasureCounter: number = 0;
              this.musicSheet = new MusicSheet();
              this.musicSheet.Path = path;
      Severity: Minor
      Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 readTitleAndComposerFromCredits has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private readTitleAndComposerFromCredits(root: IXmlElement): void {
              if (this.rules.SheetComposerSubtitleUseLegacyParsing) {
                  this.readTitleAndComposerFromCreditsLegacy(root);
                  return;
              }
      Severity: Major
      Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 3 hrs to fix

        MusicSheetReader has 29 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class MusicSheetReader /*implements IMusicSheetReader*/ {
        
            constructor(afterSheetReadingModules: IAfterSheetReadingModule[] = undefined, rules: EngravingRules = new EngravingRules()) {
             if (!afterSheetReadingModules) {
               this.afterSheetReadingModules = [];
        Severity: Minor
        Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 3 hrs to fix

          Function readTitleAndComposerFromCreditsLegacy has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private readTitleAndComposerFromCreditsLegacy(root: IXmlElement): void {
                  const systemYCoordinates: number = this.computeSystemYCoordinates(root);
                  if (systemYCoordinates === 0) {
                      return;
                  }
          Severity: Major
          Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 3 hrs to fix

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

                private computeSystemYCoordinates(root: IXmlElement): number {
                    if (!root.element("defaults")) {
                        return 0;
                    }
                    let paperHeight: number = 0;
            Severity: Minor
            Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 setSourceMeasureDuration has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

                private setSourceMeasureDuration(instrumentReaders: InstrumentReader[], sourceMeasureCounter: number): number {
                    let activeRhythm: Fraction = new Fraction(0, 1);
                    const instrumentsMaxTieNoteFractions: Fraction[] = [];
                    for (const instrumentReader of instrumentReaders) {
                        instrumentsMaxTieNoteFractions.push(instrumentReader.MaxTieNoteFraction);
            Severity: Minor
            Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 _createMusicSheet has 78 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private _createMusicSheet(root: IXmlElement, path: string): MusicSheet {
                    const instrumentReaders: InstrumentReader[] = [];
                    let sourceMeasureCounter: number = 0;
                    this.musicSheet = new MusicSheet();
                    this.musicSheet.Path = path;
            Severity: Major
            Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 3 hrs to fix

              Function checkIfRhythmInstructionsAreSetAndEqual has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private checkIfRhythmInstructionsAreSetAndEqual(instrumentReaders: InstrumentReader[]): void {
                      const rhythmInstructions: RhythmInstruction[] = [];
                      for (let i: number = 0; i < this.completeNumberOfStaves; i++) {
                          if (this.currentMeasure.FirstInstructionsStaffEntries[i]) {
                              const last: AbstractNotationInstruction = this.currentMeasure.FirstInstructionsStaffEntries[i].Instructions[
              Severity: Major
              Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 3 hrs to fix

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

                    private readTitle(root: IXmlElement): void {
                        const titleNode: IXmlElement = root.element("work");
                        let titleNodeChild: IXmlElement = undefined;
                        if (titleNode) {
                            titleNodeChild = titleNode.element("work-title");
                Severity: Minor
                Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 getCompleteNumberOfStavesFromXml has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                    private getCompleteNumberOfStavesFromXml(partInst: IXmlElement[]): number {
                        let num: number = 0;
                        for (const partNode of partInst) {
                            const xmlMeasureList: IXmlElement[] = partNode.elements("measure");
                            if (xmlMeasureList.length > 0) {
                Severity: Minor
                Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 setSourceMeasureDuration has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private setSourceMeasureDuration(instrumentReaders: InstrumentReader[], sourceMeasureCounter: number): number {
                        let activeRhythm: Fraction = new Fraction(0, 1);
                        const instrumentsMaxTieNoteFractions: Fraction[] = [];
                        for (const instrumentReader of instrumentReaders) {
                            instrumentsMaxTieNoteFractions.push(instrumentReader.MaxTieNoteFraction);
                Severity: Minor
                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 2 hrs to fix

                  Function computeSystemYCoordinates has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private computeSystemYCoordinates(root: IXmlElement): number {
                          if (!root.element("defaults")) {
                              return 0;
                          }
                          let paperHeight: number = 0;
                  Severity: Minor
                  Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 1 hr to fix

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

                        private readComposer(root: IXmlElement): void {
                            const identificationNode: IXmlElement = root.element("identification");
                            if (identificationNode) {
                                const creators: IXmlElement[] = identificationNode.elements("creator");
                                for (let idx: number = 0, len: number = creators.length; idx < len; ++idx) {
                    Severity: Minor
                    Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 readTitle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private readTitle(root: IXmlElement): void {
                            const titleNode: IXmlElement = root.element("work");
                            let titleNodeChild: IXmlElement = undefined;
                            if (titleNode) {
                                titleNodeChild = titleNode.element("work-title");
                    Severity: Minor
                    Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 1 hr to fix

                      Function initializeReading has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private initializeReading(partList: IXmlElement[], partInst: IXmlElement[], instrumentReaders: InstrumentReader[]): void {
                              const instrumentDict: { [_: string]: Instrument } = this.createInstrumentGroups(partList);
                              this.completeNumberOfStaves = this.getCompleteNumberOfStavesFromXml(partInst);
                              if (partInst.length !== 0) {
                                  this.repetitionInstructionReader.MusicSheet = this.musicSheet;
                      Severity: Minor
                      Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 1 hr to fix

                        Function checkSourceMeasureForNullEntries has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private checkSourceMeasureForNullEntries(): void {
                                for (let i: number = this.currentMeasure.VerticalSourceStaffEntryContainers.length - 1; i >= 0; i--) {
                                    for (let j: number = this.currentMeasure.VerticalSourceStaffEntryContainers[i].StaffEntries.length - 1; j >= 0; j--) {
                                        const sourceStaffEntry: SourceStaffEntry = this.currentMeasure.VerticalSourceStaffEntryContainers[i].StaffEntries[j];
                                        if (sourceStaffEntry) {
                        Severity: Minor
                        Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 1 hr to fix

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

                              private initializeReading(partList: IXmlElement[], partInst: IXmlElement[], instrumentReaders: InstrumentReader[]): void {
                                  const instrumentDict: { [_: string]: Instrument } = this.createInstrumentGroups(partList);
                                  this.completeNumberOfStaves = this.getCompleteNumberOfStavesFromXml(partInst);
                                  if (partInst.length !== 0) {
                                      this.repetitionInstructionReader.MusicSheet = this.musicSheet;
                          Severity: Minor
                          Found in src/MusicalScore/ScoreIO/MusicSheetReader.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 readCopyright has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private readCopyright(root: IXmlElement): void {
                                  const idElements: IXmlElement[] = root.elements("identification");
                                  if(idElements.length > 0){
                                      const idElement: IXmlElement = idElements[0];
                                      const rightElements: IXmlElement[] = idElement.elements("rights");
                          Severity: Minor
                          Found in src/MusicalScore/ScoreIO/MusicSheetReader.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

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (partElement.attribute("print-object") &&
                                                             partElement.attribute("print-object").value === "no") {
                                                              instrument.NameLabel.print = false;
                                                          }
                          Severity: Major
                          Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if (creditJustify === "right") {
                                                        isComposer = true;
                                                        isSubtitleOrComposer = true;
                                                    } else if (creditJustify === "center" && finalTitle) {
                                                        isSubtitle = true;
                            Severity: Major
                            Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ((creditYGiven && creditYInfo > systemYCoordinates) || isSubtitleOrComposer) {
                                                          if (!finalTitle && !isSubtitleOrComposer) {
                                                              // only take largest font size label
                                                              // const creditSize: string = creditChild.attribute("font-size")?.value;
                                                              // if (creditSize) {
                              Severity: Major
                              Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (creditChildValue === "Copyright ©") {
                                                            continue; // this seems to be a MuseScore default, useless
                                                        }
                                Severity: Major
                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (voiceEntry.Notes.length === 0) {
                                                              this._removeFromArray(voiceEntry.ParentVoice.VoiceEntries, voiceEntry);
                                                              this._removeFromArray(sourceStaffEntry.VoiceEntries, voiceEntry);
                                                          }
                                  Severity: Major
                                  Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                } else if (partElement.name === "part-abbreviation") {
                                                                    instrument.PartAbbreviation = partElement.value;
                                                                } else if (partElement.name === "score-instrument") {
                                                                    const subInstrument: SubInstrument = new SubInstrument(instrument);
                                                                    subInstrument.idString = partElement.firstAttribute.value;
                                    Severity: Major
                                    Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                              if (syslab.element("top-system-distance")) {
                                                                  const topSystemDistanceString: string = syslab.element("top-system-distance").value;
                                                                  topSystemDistance = parseFloat(topSystemDistanceString);
                                                                  found = true;
                                                                  break;
                                      Severity: Major
                                      Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if (!this.musicSheet.Subtitle) {
                                                                    if (creditJustify !== "right" && creditJustify !== "left" || isSubtitle) {
                                                                        if (largestCreditYInfo < creditYInfo) {
                                                                            largestCreditYInfo = creditYInfo;
                                                                            if (possibleTitle) {
                                        Severity: Major
                                        Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                      if (currentGroup) {
                                                                          if (currentGroup.InstrumentalGroups.length === 1) {
                                                                              const instr: InstrumentalGroup = currentGroup.InstrumentalGroups[0];
                                                                              if (currentGroup.Parent) {
                                                                                  currentGroup.Parent.InstrumentalGroups.push(instr);
                                          Severity: Major
                                          Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                    switch (creditJustify) {
                                                                        case "right":
                                                                            if (!this.musicSheet.Composer) {
                                                                                this.musicSheet.Composer = new Label(this.trimString(creditChild.value));
                                                                            }
                                            Severity: Major
                                            Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                      if (!this.musicSheet.Title && !isSubtitle) {
                                                                          const creditSize: string = creditChild.attribute("font-size")?.value;
                                                                          if (creditSize) {
                                                                              const titleCreditSizeInt: number = parseFloat(creditSize);
                                                                              if (largestTitleCreditSize < titleCreditSizeInt) {
                                              Severity: Major
                                              Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts - About 45 mins to fix

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

                                                    private getInstrumentNumberOfStavesFromXml(partNode: IXmlElement): number {
                                                        let num: number = 0;
                                                        const xmlMeasure: IXmlElement = partNode.element("measure");
                                                        if (xmlMeasure) {
                                                            const attributes: IXmlElement = xmlMeasure.element("attributes");
                                                Severity: Minor
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.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

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

                                                            for (let idx: number = 0, len: number = instrumentReaders.length; idx < len; ++idx) {
                                                                const instrumentReader: InstrumentReader = instrumentReaders[idx];
                                                                instrumentReader.ActiveRhythm = rhythmInstruction;
                                                            }
                                                Severity: Major
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 2 other locations - About 1 hr to fix
                                                src/MusicalScore/Graphical/MusicSystemBuilder.ts on lines 261..264
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 298..301

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

                                                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 = instrumentReaders.length; idx < len; ++idx) {
                                                                const instrumentReader: InstrumentReader = instrumentReaders[idx];
                                                                instrumentReader.ActiveRhythm = rhythmInstruction;
                                                            }
                                                Severity: Major
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 2 other locations - About 1 hr to fix
                                                src/MusicalScore/Graphical/MusicSystemBuilder.ts on lines 261..264
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 313..316

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

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                                                        } else if (instrumentElement.name === "volume") {
                                                                                            try {
                                                                                                const result: number = parseFloat(instrumentElement.value);
                                                                                                subInstrument.volume = result / 127.0;
                                                                                            } catch (ex) {
                                                Severity: Major
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 1 other location - About 1 hr to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 965..973

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

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                                                        } else if (instrumentElement.name === "pan") {
                                                                                            try {
                                                                                                const result: number = parseFloat(instrumentElement.value);
                                                                                                subInstrument.pan = result / 64.0;
                                                                                            } catch (ex) {
                                                Severity: Major
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 1 other location - About 1 hr to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 957..973

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

                                                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

                                                                            case "left":
                                                                                if (!this.musicSheet.Lyricist) {
                                                                                    this.musicSheet.Lyricist = new Label(this.trimString(creditChild.value));
                                                                                }
                                                                                break;
                                                Severity: Minor
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 1 other location - About 55 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 784..788

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 53.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                            if (syslay.element("top-system-distance")) {
                                                                const topSystemDistanceString: string = root.element("defaults").element("system-layout").element("top-system-distance").value;
                                                                topSystemDistance = parseFloat(topSystemDistanceString);
                                                            }
                                                Severity: Minor
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 1 other location - About 55 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 815..818

                                                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

                                                        try {
                                                            const defi: string = root.element("defaults").element("page-layout").element("page-height").value;
                                                            paperHeight = parseFloat(defi);
                                                        } catch (e) {
                                                Severity: Minor
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 1 other location - About 55 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 848..851

                                                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

                                                                            case "right":
                                                                                if (!this.musicSheet.Composer) {
                                                                                    this.musicSheet.Composer = new Label(this.trimString(creditChild.value));
                                                                                }
                                                                                break;
                                                Severity: Minor
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 1 other location - About 55 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 789..793

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

                                                        if (!this.musicSheet.Title && finalTitle) {
                                                            this.musicSheet.Title = new Label(this.trimString(finalTitle));
                                                        }
                                                Severity: Major
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 3 other locations - About 40 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 690..692
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 693..695
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 804..806

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

                                                        if (!this.musicSheet.Title && finalTitle) {
                                                            this.musicSheet.Title = new Label(this.trimString(finalTitle));
                                                        }
                                                Severity: Major
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 3 other locations - About 40 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 693..695
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 801..803
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 804..806

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

                                                        if (!this.musicSheet.Subtitle && finalSubtitle) {
                                                            this.musicSheet.Subtitle = new Label(this.trimString(finalSubtitle));
                                                        }
                                                Severity: Major
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 3 other locations - About 40 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 690..692
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 693..695
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 801..803

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

                                                        if (!this.musicSheet.Subtitle && finalSubtitle) {
                                                            this.musicSheet.Subtitle = new Label(this.trimString(finalSubtitle));
                                                        }
                                                Severity: Major
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 3 other locations - About 40 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 690..692
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 801..803
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 804..806

                                                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 (isNaN(num) || num <= 0) {
                                                            const errorMsg: string = ITextTranslation.translateText(
                                                                "ReaderErrorMessages/StaffError", "Invalid number of staves."
                                                            );
                                                            throw new MusicSheetReadingException(errorMsg);
                                                Severity: Minor
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 1 other location - About 35 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 1094..1099

                                                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

                                                        if (isNaN(num) || num <= 0) {
                                                            const errorMsg: string = ITextTranslation.translateText(
                                                                "ReaderErrorMessages/StaffError", "Invalid number of Staves."
                                                            );
                                                            throw new MusicSheetReadingException(errorMsg);
                                                Severity: Minor
                                                Found in src/MusicalScore/ScoreIO/MusicSheetReader.ts and 1 other location - About 35 mins to fix
                                                src/MusicalScore/ScoreIO/MusicSheetReader.ts on lines 1065..1070

                                                Duplicated Code

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

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

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

                                                Tuning

                                                This issue has a mass of 46.

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

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

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

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

                                                Refactorings

                                                Further Reading

                                                There are no issues that match your filters.

                                                Category
                                                Status