leonitousconforti/tinyburg

View on GitHub

Showing 100 of 824 total issues

Avoid deeply nested control flow statements.
Open

                    if (!process.env[environmentVariableName]) {
                        // No, so trim this line
                        lineShouldBeTrimmed = true;
                        break;
                    }
Severity: Major
Found in common/scripts/install-run.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (mask && mask.pixels[t_y * mask.width + t_x] < 255) {
                            continue;
                        }
    Severity: Major
    Found in packages/doorman/src/image-operations/template-matching.ts - About 45 mins to fix

      Function installAndRun has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function installAndRun(logger, packageName, packageVersion, packageBinName, packageBinArgs, lockFilePath = process.env[INSTALL_RUN_LOCKFILE_PATH_VARIABLE]) {
      Severity: Minor
      Found in common/scripts/install-run.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (SAD > 0 && wantExact) {
                                exact = false;
                                break;
                            }
        Severity: Major
        Found in packages/doorman/src/image-operations/template-matching.ts - About 45 mins to fix

          Function _installPackage has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function _installPackage(logger, packageInstallFolder, name, version, command) {
          Severity: Minor
          Found in common/scripts/install-run.js - About 35 mins to fix

            Function modifySave has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            >(saveDataToModify: T, keys: U, values: V, forceLoadStructs: boolean = false, logger: ILogger = debug): Promise<T> {
            Severity: Minor
            Found in packages/nucleus/src/modify-save.ts - About 35 mins to fix

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

              export const sendItem = async (
                  config: IConfig,
                  { itemType, sendTo, item }: SendItemParameters,
                  logger: ILogger = debug
              ): Promise<ISendItem> => {
              Severity: Minor
              Found in packages/nucleus/src/endpoints/send-item.ts - About 35 mins to fix

              Cognitive Complexity

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

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

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

              Further reading

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

              export const grayscaleImage = (sourceImage: Image): Image => {
                  sourceImageGuard(sourceImage);
                  assert(sourceImage.channels === 3, "Source image must have three channels");
                  assert(
                      sourceImage.format === ImageType.RGB || sourceImage.format === ImageType.BGR,
              Severity: Minor
              Found in packages/doorman/src/image-operations/grayscale-image.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

              Avoid too many return statements within this function.
              Open

                          return (field as Il2Cpp.Field<Il2Cpp.ValueType>).value.toString();
              Severity: Major
              Found in packages/insight/src/helpers/read.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return logger.fatal(new Error("Hash verification failed when checking for newer save"));
                Severity: Major
                Found in packages/nucleus/src/endpoints/check-for-newer-save.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return logger.fatal(new Error("Bad server response"));
                  Severity: Major
                  Found in packages/nucleus/src/endpoints/friends.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return 2;
                    Severity: Major
                    Found in packages/nucleus/src/compare-saves.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return string;
                      Severity: Major
                      Found in packages/insight/src/helpers/read.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return 2;
                        Severity: Major
                        Found in packages/nucleus/src/compare-saves.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return logger.fatal(new Error("Bad server response"));
                          Severity: Major
                          Found in packages/nucleus/src/endpoints/check-for-newer-save.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return (object as unknown as Il2Cpp.ValueType).toString();
                            Severity: Major
                            Found in packages/insight/src/helpers/read.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                              return Object.fromEntries(entries);
                              Severity: Major
                              Found in packages/insight/src/helpers/read.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    return logger.fatal(new Error("Bad server response"));
                                Severity: Major
                                Found in packages/nucleus/src/endpoints/snapshots.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return undefined;
                                  Severity: Major
                                  Found in packages/insight/src/helpers/read.ts - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                return (field as Il2Cpp.Field<Il2Cpp.String>).value.content!;
                                    Severity: Major
                                    Found in packages/insight/src/helpers/read.ts - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language