wkdhkr/dedupper

View on GitHub

Showing 303 of 303 total issues

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

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

                new cv.Point(
                  ...MathHelper.rotatePoint(
                    fr.left + fr.width,
                    fr.top + fr.height,
                    centerX,
        Severity: Minor
        Found in src/services/deepLearning/facePP/FacePPService.js and 1 other location - About 35 mins to fix
        src/services/deepLearning/facePP/FacePPService.js on lines 250..258

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

        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

                new cv.Point(
                  ...MathHelper.rotatePoint(
                    fr.left + fr.width,
                    fr.top + fr.height,
                    centerX,
        Severity: Minor
        Found in src/services/deepLearning/facePP/FacePPService.js and 1 other location - About 35 mins to fix
        src/services/deepLearning/facePP/FacePPService.js on lines 262..270

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

        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

            const y2 =
              (x - centerX) * Math.sin(angle) +
              (y - centerY) * Math.cos(angle) +
              centerY;
        Severity: Minor
        Found in src/helpers/MathHelper.js and 1 other location - About 35 mins to fix
        src/helpers/MathHelper.js on lines 17..20

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

        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

            const x2 =
              (x - centerX) * Math.cos(angle) -
              (y - centerY) * Math.sin(angle) +
              centerX;
        Severity: Minor
        Found in src/helpers/MathHelper.js and 1 other location - About 35 mins to fix
        src/helpers/MathHelper.js on lines 21..24

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

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

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

          isEraseReasonType: (type: ReasonType) => boolean = (
            type: ReasonType
          ): boolean =>
            [
              TYPE_FILE_MARK_ERASE,
        Severity: Minor
        Found in src/services/judgment/ReasonLogic.js and 2 other locations - About 35 mins to fix
        src/services/judgment/ReasonLogic.js on lines 87..95
        src/services/judgment/TypeLogic.js on lines 48..56

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

          isForgetType: (type: ClassifyType) => boolean = (
            type: ClassifyType
          ): boolean =>
            [
              TYPE_UNKNOWN,
        Severity: Minor
        Found in src/services/judgment/TypeLogic.js and 2 other locations - About 35 mins to fix
        src/services/judgment/ReasonLogic.js on lines 73..81
        src/services/judgment/ReasonLogic.js on lines 87..95

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

          isDedupeReasonType: (type: ReasonType) => boolean = (
            type: ReasonType
          ): boolean =>
            [
              TYPE_FILE_MARK_DEDUPE,
        Severity: Minor
        Found in src/services/judgment/ReasonLogic.js and 2 other locations - About 35 mins to fix
        src/services/judgment/ReasonLogic.js on lines 73..81
        src/services/judgment/TypeLogic.js on lines 48..56

        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

        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
              Severity
              Category
              Status
              Source
              Language