wkdhkr/dedupper

View on GitHub

Showing 119 of 303 total issues

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

  [ay, ax]: [number, number],
  [by, bx]: [number, number],
  color: string,
  scale: number,
  ctx: any
Severity: Minor
Found in src/services/deepLearning/bodyPix/demo_util.js - About 35 mins to fix

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

    export function drawSegment([ay, ax], [by, bx], color, scale, ctx) {
    Severity: Minor
    Found in src/services/deepLearning/poseNet/demo_util.js - About 35 mins to fix

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

      export function drawPoint(ctx, y, x, r, color) {
      Severity: Minor
      Found in src/services/deepLearning/poseNet/demo_util.js - About 35 mins to fix

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

          heatMapValues,
          offsets,
          outputStride,
          scale = 1,
          ctx
        Severity: Minor
        Found in src/services/deepLearning/poseNet/demo_util.js - About 35 mins to fix

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

          const parseBody = (body: any, table: string): any => {
            const stringColumns = ["meta", "trim"];
            const numberColumns = [
              "missing",
              "orientation",
          Severity: Minor
          Found in src/servers/routes/sqliteUpdateRoute.js - 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 detectAcdUploadModeAndId has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            async detectAcdUploadModeAndId(
              psRow: ProcessStateRow,
              row: HashRow
            ): Promise<// [null | "override" | "upload", null | string, null | string, null | string]
            any> {
          Severity: Minor
          Found in src/services/amazon/ACDSyncService.js - 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 lockKey has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            static async lockKey(key: string, force: boolean = false) {
              if (key === "") {
                return;
              }
              let count = 1;
          Severity: Minor
          Found in src/helpers/LockHelper.js - 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 setDatGuiPropertyCss has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function setDatGuiPropertyCss(propertyText, liCssString, spanCssString = "") {
            const spans = document.getElementsByClassName("property-name");
            for (let i = 0; i < spans.length; i++) {
              const text = spans[i].textContent || spans[i].innerText;
              if (text == propertyText) {
          Severity: Minor
          Found in src/services/deepLearning/poseNet/demo_util.js - 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 processFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            async processFile(): Promise<boolean> {
              if (QueueHelper.operationWaitPromises.length > 100) {
                await QueueHelper.waitOperationWaitPromises();
              }
              await ProcessHelper.waitCpuIdle(this.config.maxCpuLoadPercent);
          Severity: Minor
          Found in src/services/ProcessService.js - 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 logResult has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            logResult(
              { from_path: fromPath, size, width, height, p_hash: pHash }: FileInfo,
              result: JudgeResultSimple | JudgeResult
            ): JudgeResult {
              let message = null;
          Severity: Minor
          Found in src/services/judgment/ResultLogic.js - 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 loadTensorflowModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            static loadTensorflowModule(backEnd: "cpu" | "gpu"): "cpu" | "gpu" {
              let finalBackEnd: "gpu" | "cpu" = backEnd;
              let tf;
              if (DeepLearningHelper.isTensorflowModuleLoaded) {
                return DeepLearningHelper.tfjsBackEnd;
          Severity: Minor
          Found in src/helpers/DeepLearningHelper.js - 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 null;
          Severity: Major
          Found in src/services/fs/FileCacheService.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return this.rl.logResult(fileInfo, [
                      TYPE_TRANSFER,
                      (await this.detectReplaceFile(fileInfo, storedFileInfoByPHashs)) ||
                        storedFileInfoByPHashs[0],
                      TYPE_FILE_MARK_TRANSFER
            Severity: Major
            Found in src/services/judgment/PathLogic.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return new Set([MARK_BLOCK]);
              Severity: Major
              Found in src/helpers/FileNameMarkHelper.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return null;
                Severity: Major
                Found in src/services/judgment/TypeLogic.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return this.rl.logResult(fileInfo, [TYPE_HOLD, null, TYPE_DEEP_LEARNING]);
                  Severity: Major
                  Found in src/services/judgment/JudgmentService.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return fileInfo;
                    Severity: Major
                    Found in src/services/fs/FileCacheService.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return this.rl.logResult(fileInfo, [TYPE_SAVE, null, TYPE_NO_PROBLEM]);
                      Severity: Major
                      Found in src/services/judgment/JudgmentService.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return [TYPE_SWEEP_DEDUPPER_FILE, TYPE_DELETE];
                        Severity: Major
                        Found in src/services/judgment/TypeLogic.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return this.phl.handlePHashHit(fileInfo, storedFileInfoByPHashs);
                          Severity: Major
                          Found in src/services/judgment/JudgmentService.js - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language