emmercm/igir

View on GitHub

Showing 444 of 448 total issues

Function toCsv has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async toCsv(options: Options): Promise<string> {
    const foundReleaseCandidates = DATStatus.getValuesForAllowedTypes(
      options,
      this.foundRomTypesToReleaseCandidates,
    );
Severity: Major
Found in src/types/datStatus.ts - About 3 hrs to fix

    Function parseCmproDat has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

      private parseCmproDat(datFile: File, fileContents: string): DAT | undefined {
        /**
         * Validation that this might be a CMPro file.
         */
        if (fileContents.match(/^(clrmamepro|game|resource) \(\r?\n(\s.+\r?\n)+\)$/m) === null) {
    Severity: Minor
    Found in src/modules/dats/datScanner.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 getGameType has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

      getGameType(): GameType {
        // NOTE(cemmer): priority here matters!
        if (this.isBios()) {
          return GameType.BIOS;
        }
    Severity: Minor
    Found in src/types/dats/game.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 fromFiles has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static fromFiles(files: File[]): IndexedFiles {
        const crc32RawMap = new Map<string, File[]>();
        const crc32WithoutHeaderMap = new Map<string, File[]>();
        const md5RawMap = new Map<string, File[]>();
        const md5WithoutHeaderMap = new Map<string, File[]>();
    Severity: Major
    Found in src/types/indexedFiles.ts - About 3 hrs to fix

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

        private preferGoodSort(a: ReleaseCandidate, b: ReleaseCandidate): number {
          if (!this.options.getPreferGood()) {
            return 0;
          }
          return (b.getGame().isBad() ? 0 : 1) - (a.getGame().isBad() ? 0 : 1);
      Severity: Major
      Found in src/modules/candidates/candidatePreferer.ts and 3 other locations - About 3 hrs to fix
      src/modules/candidates/candidatePreferer.ts on lines 163..168
      src/modules/candidates/candidatePreferer.ts on lines 224..229
      src/modules/candidates/candidatePreferer.ts on lines 231..236

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 96.

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

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

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

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

      Refactorings

      Further Reading

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

        private preferRetailSort(a: ReleaseCandidate, b: ReleaseCandidate): number {
          if (!this.options.getPreferRetail()) {
            return 0;
          }
          return (a.getGame().isRetail() ? 0 : 1) - (b.getGame().isRetail() ? 0 : 1);
      Severity: Major
      Found in src/modules/candidates/candidatePreferer.ts and 3 other locations - About 3 hrs to fix
      src/modules/candidates/candidatePreferer.ts on lines 163..168
      src/modules/candidates/candidatePreferer.ts on lines 170..175
      src/modules/candidates/candidatePreferer.ts on lines 231..236

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 96.

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

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

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

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

      Refactorings

      Further Reading

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

        private preferParentSort(a: ReleaseCandidate, b: ReleaseCandidate): number {
          if (!this.options.getPreferParent()) {
            return 0;
          }
          return (a.getGame().isParent() ? 0 : 1) - (b.getGame().isParent() ? 0 : 1);
      Severity: Major
      Found in src/modules/candidates/candidatePreferer.ts and 3 other locations - About 3 hrs to fix
      src/modules/candidates/candidatePreferer.ts on lines 163..168
      src/modules/candidates/candidatePreferer.ts on lines 170..175
      src/modules/candidates/candidatePreferer.ts on lines 224..229

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 96.

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

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

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

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

      Refactorings

      Further Reading

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

        private preferVerifiedSort(a: ReleaseCandidate, b: ReleaseCandidate): number {
          if (!this.options.getPreferVerified()) {
            return 0;
          }
          return (a.getGame().isVerified() ? 0 : 1) - (b.getGame().isVerified() ? 0 : 1);
      Severity: Major
      Found in src/modules/candidates/candidatePreferer.ts and 3 other locations - About 3 hrs to fix
      src/modules/candidates/candidatePreferer.ts on lines 170..175
      src/modules/candidates/candidatePreferer.ts on lines 224..229
      src/modules/candidates/candidatePreferer.ts on lines 231..236

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 96.

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

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

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

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

      Refactorings

      Further Reading

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

        static async entryOf<A extends Archive>(
          archiveEntryProps: ArchiveEntryProps<A>,
          checksumBitmask: number = ChecksumBitmask.NONE,
        ): Promise<ArchiveEntry<A>> {
          let finalSize = archiveEntryProps.size;
      Severity: Major
      Found in src/types/files/archives/archiveEntry.ts - About 3 hrs to fix

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

          getMergeRoms(): MergeMode | undefined {
            const mergeMode = Object.keys(MergeMode).find(
              (mode) => mode.toLowerCase() === this.mergeRoms?.toLowerCase(),
            );
            if (!mergeMode) {
        Severity: Major
        Found in src/types/options.ts and 5 other locations - About 2 hrs to fix
        src/types/options.ts on lines 771..779
        src/types/options.ts on lines 781..789
        src/types/options.ts on lines 915..923
        src/types/options.ts on lines 925..933
        src/types/options.ts on lines 1208..1216

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

          getInputChecksumMax(): ChecksumBitmask | undefined {
            const checksumBitmask = Object.keys(ChecksumBitmask).find(
              (bitmask) => bitmask.toUpperCase() === this.inputChecksumMax?.toUpperCase(),
            );
            if (!checksumBitmask) {
        Severity: Major
        Found in src/types/options.ts and 5 other locations - About 2 hrs to fix
        src/types/options.ts on lines 771..779
        src/types/options.ts on lines 915..923
        src/types/options.ts on lines 925..933
        src/types/options.ts on lines 1028..1036
        src/types/options.ts on lines 1208..1216

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

          getDirGameSubdir(): GameSubdirMode | undefined {
            const subdirMode = Object.keys(GameSubdirMode).find(
              (mode) => mode.toLowerCase() === this.dirGameSubdir?.toLowerCase(),
            );
            if (!subdirMode) {
        Severity: Major
        Found in src/types/options.ts and 5 other locations - About 2 hrs to fix
        src/types/options.ts on lines 771..779
        src/types/options.ts on lines 781..789
        src/types/options.ts on lines 925..933
        src/types/options.ts on lines 1028..1036
        src/types/options.ts on lines 1208..1216

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

            return this.getFiles().reduce((map, file) => {
              const key = file.getFilePath();
              if (!map.has(key)) {
                map.set(key, [file]);
              } else {
        Severity: Major
        Found in src/types/indexedFiles.ts and 1 other location - About 2 hrs to fix
        src/modules/candidates/candidatePatchGenerator.ts on lines 54..62

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

            return patches.reduce((map, patch) => {
              const key = patch.getCrcBefore();
              if (!map.has(key)) {
                map.set(key, [patch]);
              } else {
        Severity: Major
        Found in src/modules/candidates/candidatePatchGenerator.ts and 1 other location - About 2 hrs to fix
        src/types/indexedFiles.ts on lines 161..169

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

          getFixExtension(): FixExtension | undefined {
            const fixExtensionMode = Object.keys(FixExtension).find(
              (mode) => mode.toLowerCase() === this.fixExtension?.toLowerCase(),
            );
            if (!fixExtensionMode) {
        Severity: Major
        Found in src/types/options.ts and 5 other locations - About 2 hrs to fix
        src/types/options.ts on lines 771..779
        src/types/options.ts on lines 781..789
        src/types/options.ts on lines 915..923
        src/types/options.ts on lines 1028..1036
        src/types/options.ts on lines 1208..1216

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

          getInputChecksumMin(): ChecksumBitmask | undefined {
            const checksumBitmask = Object.keys(ChecksumBitmask).find(
              (bitmask) => bitmask.toUpperCase() === this.inputChecksumMin?.toUpperCase(),
            );
            if (!checksumBitmask) {
        Severity: Major
        Found in src/types/options.ts and 5 other locations - About 2 hrs to fix
        src/types/options.ts on lines 781..789
        src/types/options.ts on lines 915..923
        src/types/options.ts on lines 925..933
        src/types/options.ts on lines 1028..1036
        src/types/options.ts on lines 1208..1216

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

          getPreferRevision(): PreferRevision | undefined {
            const preferRevision = Object.keys(PreferRevision).find(
              (mode) => mode.toLowerCase() === this.preferRevision?.toLowerCase(),
            );
            if (!preferRevision) {
        Severity: Major
        Found in src/types/options.ts and 5 other locations - About 2 hrs to fix
        src/types/options.ts on lines 771..779
        src/types/options.ts on lines 781..789
        src/types/options.ts on lines 915..923
        src/types/options.ts on lines 925..933
        src/types/options.ts on lines 1028..1036

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 93.

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

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

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

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

        Refactorings

        Further Reading

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

          async scanPatchFilesWithoutExclusions(walkCallback?: FsWalkCallback): Promise<string[]> {
            const patchFiles = await this.scanPatchFiles(walkCallback);
            const patchExcludeFiles = new Set(await this.scanPatchExcludeFiles());
            return patchFiles.filter((patchPath) => !patchExcludeFiles.has(patchPath));
          }
        Severity: Major
        Found in src/types/options.ts and 2 other locations - About 2 hrs to fix
        src/types/options.ts on lines 642..646
        src/types/options.ts on lines 819..823

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

        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

          async scanDatFilesWithoutExclusions(walkCallback?: FsWalkCallback): Promise<string[]> {
            const datFiles = await this.scanDatFiles(walkCallback);
            const datExcludeFiles = new Set(await this.scanDatExcludeFiles());
            return datFiles.filter((inputPath) => !datExcludeFiles.has(inputPath));
          }
        Severity: Major
        Found in src/types/options.ts and 2 other locations - About 2 hrs to fix
        src/types/options.ts on lines 642..646
        src/types/options.ts on lines 856..860

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

        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

          async scanInputFilesWithoutExclusions(walkCallback?: FsWalkCallback): Promise<string[]> {
            const inputFiles = await this.scanInputFiles(walkCallback);
            const inputExcludeFiles = new Set(await this.scanInputExcludeFiles());
            return inputFiles.filter((inputPath) => !inputExcludeFiles.has(inputPath));
          }
        Severity: Major
        Found in src/types/options.ts and 2 other locations - About 2 hrs to fix
        src/types/options.ts on lines 819..823
        src/types/options.ts on lines 856..860

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

        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

        Severity
        Category
        Status
        Source
        Language