emmercm/igir

View on GitHub

Showing 444 of 448 total issues

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

    if (cmproDat.game) {
      if (Array.isArray(cmproDat.game)) {
        cmproDatGames = cmproDat.game;
      } else {
        cmproDatGames = [cmproDat.game];
Severity: Major
Found in src/modules/dats/datScanner.ts and 2 other locations - About 1 hr to fix
src/modules/dats/datScanner.ts on lines 382..388
src/modules/dats/datScanner.ts on lines 401..407

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

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 hashedReleaseCandidates has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

              releaseCandidates.map(async (releaseCandidate) => {
                const hashedRomsWithFiles = await Promise.all(
                  releaseCandidate.getRomsWithFiles().map(async (romWithFiles) => {
                    const correctedRom = await this.buildCorrectedRom(
                      dat,
Severity: Minor
Found in src/modules/candidates/candidateExtensionCorrector.ts - About 1 hr to fix

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

      private async downloadDats(datFiles: File[]): Promise<File[]> {
        if (!datFiles.some((datFile) => datFile.isURL())) {
          return datFiles;
        }
    
    
    Severity: Minor
    Found in src/modules/dats/datScanner.ts - About 1 hr to fix

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

        async hash(
          dat: DAT,
          parentsToCandidates: Map<Parent, ReleaseCandidate[]>,
        ): Promise<Map<Parent, ReleaseCandidate[]>> {
          if (parentsToCandidates.size === 0) {
      Severity: Minor
      Found in src/modules/candidates/candidateArchiveFileHasher.ts - About 1 hr to fix

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

          private async build(
            dat: DAT,
            parentsToCandidates: Map<Parent, ReleaseCandidate[]>,
            crcToPatches: Map<string, Patch[]>,
          ): Promise<Map<Parent, ReleaseCandidate[]>> {
        Severity: Minor
        Found in src/modules/candidates/candidatePatchGenerator.ts - About 1 hr to fix

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

            private sortMap(checksumsToFiles: ChecksumsToFiles): void {
              const outputDir = path.resolve(this.options.getOutputDirRoot());
              const outputDirDisk = FsPoly.diskResolved(outputDir);
          
              [...checksumsToFiles.values()].forEach((files) =>
          Severity: Minor
          Found in src/modules/roms/romIndexer.ts - About 1 hr to fix

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

              async loadFile(cacheFilePath: string): Promise<void> {
                this.cache = await new Cache<CacheValue>({
                  filePath: cacheFilePath,
                  fileFlushMillis: 60_000,
                  saveOnExit: true,
            Severity: Minor
            Found in src/types/files/fileCache.ts - About 1 hr to fix

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

                    [...parentsToCandidates.values()]
                      .flat()
                      .flatMap((releaseCandidate) => releaseCandidate.getRomsWithFiles())
                      .map((romWithFiles) => romWithFiles.getRom())
              Severity: Major
              Found in src/modules/fixdatCreator.ts and 1 other location - About 1 hr to fix
              src/modules/candidates/candidateCombiner.ts on lines 58..61

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                  const roms = [...parentsToCandidates.values()]
                    .flat()
                    .flatMap((releaseCandidate) => releaseCandidate.getRomsWithFiles())
                    .map((romWithFiles) => romWithFiles.getRom());
              Severity: Major
              Found in src/modules/candidates/candidateCombiner.ts and 1 other location - About 1 hr to fix
              src/modules/fixdatCreator.ts on lines 46..49

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                    {
                      adam: 'PCECD',
                      batocera: 'pcenginecd',
                      emulationstation: 'pcenginecd',
                      jelos: 'tg16cd',
              Severity: Major
              Found in src/types/gameConsole.ts and 2 other locations - About 1 hr to fix
              src/types/gameConsole.ts on lines 164..176
              src/types/gameConsole.ts on lines 1184..1196

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                  new GameConsole(/Supervision/i, ['.sv'], {
                    adam: 'SUPERVISION',
                    batocera: 'supervision',
                    emulationstation: 'supervision',
                    jelos: 'supervision',
              Severity: Major
              Found in src/types/gameConsole.ts and 1 other location - About 1 hr to fix
              src/types/gameConsole.ts on lines 529..539

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                    {
                      adam: 'A2600',
                      batocera: 'atari2600',
                      emulationstation: 'atari2600',
                      jelos: 'atari2600',
              Severity: Major
              Found in src/types/gameConsole.ts and 2 other locations - About 1 hr to fix
              src/types/gameConsole.ts on lines 648..660
              src/types/gameConsole.ts on lines 1184..1196

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                async withFileHeader(fileHeader: ROMHeader): Promise<File> {
                  if (fileHeader === this.fileHeader) {
                    return this;
                  }
                  return File.fileOf(
              Severity: Major
              Found in src/types/files/file.ts and 1 other location - About 1 hr to fix
              src/types/files/archives/archiveEntry.ts on lines 229..241

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                async withFileHeader(fileHeader: ROMHeader): Promise<ArchiveEntry<A>> {
                  if (fileHeader === this.fileHeader) {
                    return this;
                  }
                  return ArchiveEntry.entryOf(
              Severity: Major
              Found in src/types/files/archives/archiveEntry.ts and 1 other location - About 1 hr to fix
              src/types/files/file.ts on lines 466..478

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                  new GameConsole(/7800/, ['.a78'], {
                    adam: 'A7800',
                    batocera: 'atari7800',
                    emulationstation: 'atari7800',
                    jelos: 'atari7800',
              Severity: Major
              Found in src/types/gameConsole.ts and 1 other location - About 1 hr to fix
              src/types/gameConsole.ts on lines 408..419

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                  new GameConsole(/ColecoVision/i, ['.col'], {
                    adam: 'COLECO',
                    batocera: 'colecovision',
                    emulationstation: 'colecovision',
                    jelos: 'coleco',
              Severity: Major
              Found in src/types/gameConsole.ts and 1 other location - About 1 hr to fix
              src/types/gameConsole.ts on lines 189..200

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                  new GameConsole(/Intellivision/i, ['.int'], {
                    adam: 'INTELLI',
                    batocera: 'intellivision',
                    emulationstation: 'intellivision',
                    jelos: 'intellivision',
              Severity: Major
              Found in src/types/gameConsole.ts and 1 other location - About 1 hr to fix
              src/types/gameConsole.ts on lines 1297..1307

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                    if (this.options.getCleanDryRun()) {
                      this.progressBar.logInfo(
                        `paths skipped from cleaning (dry run):\n${filesToClean.map((filePath) => `  ${filePath}`).join('\n')}`,
                      );
                    } else {
              Severity: Major
              Found in src/modules/directoryCleaner.ts and 1 other location - About 1 hr to fix
              src/modules/directoryCleaner.ts on lines 85..91

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                      if (this.options.getCleanDryRun()) {
                        this.progressBar.logInfo(
                          `paths skipped from cleaning (dry run):\n${emptyDirs.map((filePath) => `  ${filePath}`).join('\n')}`,
                        );
                      } else {
              Severity: Major
              Found in src/modules/directoryCleaner.ts and 1 other location - About 1 hr to fix
              src/modules/directoryCleaner.ts on lines 61..72

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

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

                  new GameConsole(/PlayStation|psx/i, ['.minipsf', '.pbp', '.psexe', '.psf'], {
                    adam: 'PS',
                    batocera: 'psx',
                    emulationstation: 'psx',
                    funkeyos: 'PS1',
              Severity: Major
              Found in src/types/gameConsole.ts and 2 other locations - About 1 hr to fix
              src/types/gameConsole.ts on lines 164..176
              src/types/gameConsole.ts on lines 648..660

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 57.

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

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

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

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

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language