wkdhkr/dedupper

View on GitHub
__tests__/services/db/FacePPDbService.test.js

Summary

Maintainability
F
3 wks
Test Coverage

Function insert has 459 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      const insert = async filePath => {
        config.path = filePath;
        const fs = new FileService(config);
        const subject = new Subject(config);
        const fileInfo = await fs.collectFileInfo();
Severity: Major
Found in __tests__/services/db/FacePPDbService.test.js - About 2 days to fix

    File FacePPDbService.test.js has 899 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /** @flow */
    import { default as Subject } from "../../../src/services/db/FacePPDbService";
    import FileService from "../../../src/services/fs/FileService";
    import TestHelper from "../../../src/helpers/TestHelper";
    import DeepLearningHelper from "../../../src/helpers/DeepLearningHelper";
    Severity: Major
    Found in __tests__/services/db/FacePPDbService.test.js - About 2 days to fix

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

                    landmark: {
                      mouth_upper_lip_left_contour2: {
                        y: 210,
                        x: 238
                      },
      Severity: Major
      Found in __tests__/services/db/FacePPDbService.test.js and 1 other location - About 1 wk to fix
      __tests__/services/db/FacePPDbService.test.js on lines 553..886

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

      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

                  landmark: {
                    mouth_upper_lip_left_contour2: {
                      y: 210,
                      x: 238
                    },
      Severity: Major
      Found in __tests__/services/db/FacePPDbService.test.js and 1 other location - About 1 wk to fix
      __tests__/services/db/FacePPDbService.test.js on lines 25..358

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

      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

                      eyestatus: {
                        left_eye_status: {
                          normal_glass_eye_open: 4.976,
                          no_glass_eye_close: 0,
                          occlusion: 0.011,
      Severity: Major
      Found in __tests__/services/db/FacePPDbService.test.js and 1 other location - About 2 hrs to fix
      __tests__/services/db/FacePPDbService.test.js on lines 921..938

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

      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

                    eyestatus: {
                      left_eye_status: {
                        dark_glasses: 0.092,
                        no_glass_eye_close: 0.002,
                        no_glass_eye_open: 94.919,
      Severity: Major
      Found in __tests__/services/db/FacePPDbService.test.js and 1 other location - About 2 hrs to fix
      __tests__/services/db/FacePPDbService.test.js on lines 417..434

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

      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

                    eyegaze: {
                      left_eye_gaze: {
                        position_x_coordinate: 0.619,
                        position_y_coordinate: 0.359,
                        vector_x_component: 0.136,
      Severity: Major
      Found in __tests__/services/db/FacePPDbService.test.js and 1 other location - About 1 hr to fix
      __tests__/services/db/FacePPDbService.test.js on lines 442..457

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

      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

                      eyegaze: {
                        right_eye_gaze: {
                          position_x_coordinate: 0.628,
                          vector_z_component: 0.865,
                          vector_x_component: 0.382,
      Severity: Major
      Found in __tests__/services/db/FacePPDbService.test.js and 1 other location - About 1 hr to fix
      __tests__/services/db/FacePPDbService.test.js on lines 905..920

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

      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

                      blur: {
                        blurness: {
                          threshold: 50,
                          value: 0.682
                        },
      Severity: Minor
      Found in __tests__/services/db/FacePPDbService.test.js and 1 other location - About 55 mins to fix
      __tests__/services/db/FacePPDbService.test.js on lines 890..894

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

      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

                    blur: {
                      blurness: { threshold: 50, value: 0.682 },
                      gaussianblur: { threshold: 50, value: 0.682 },
                      motionblur: { threshold: 50, value: 0.682 }
                    },
      Severity: Minor
      Found in __tests__/services/db/FacePPDbService.test.js and 1 other location - About 55 mins to fix
      __tests__/services/db/FacePPDbService.test.js on lines 399..412

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

      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

      There are no issues that match your filters.

      Category
      Status