wkdhkr/dedupper

View on GitHub

Showing 303 of 303 total issues

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

  readResultsFromFileCache: (fileInfo: FileInfo) => ?FacePPResult = (
    fileInfo: FileInfo
  ): ?FacePPResult => {
    if (fileInfo.facePP) {
      if (
Severity: Major
Found in src/services/deepLearning/facePP/FacePPService.js and 1 other location - About 1 hr to fix
src/services/deepLearning/NsfwJsService.js on lines 59..71

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

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

  readResultsFromFileCache: (fileInfo: FileInfo) => ?Array<NsfwJsResult> = (
    fileInfo: FileInfo
  ): ?(NsfwJsResult[]) => {
    if (fileInfo.nsfwJs) {
      if (
Severity: Major
Found in src/services/deepLearning/NsfwJsService.js and 1 other location - About 1 hr to fix
src/services/deepLearning/facePP/FacePPService.js on lines 132..144

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

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

export function drawHeatMapValues(heatMapValues, outputStride, canvas) {
  const ctx = canvas.getContext("2d");
  const radius = 5;
  const scaledValues = heatMapValues.mul(tf.scalar(outputStride, "int32"));

Severity: Major
Found in src/services/deepLearning/poseNet/demo_util.js and 1 other location - About 1 hr to fix
src/services/deepLearning/bodyPix/demo_util.js on lines 195..205

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

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

export function drawHeatMapValues(
  heatMapValues: any,
  outputStride: number,
  c: any
) {
Severity: Major
Found in src/services/deepLearning/bodyPix/demo_util.js and 1 other location - About 1 hr to fix
src/services/deepLearning/poseNet/demo_util.js on lines 197..203

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

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

    try {
      return this.psds.insert(ps);
    } catch (e) {
      this.log.warn(e);
    } finally {
Severity: Major
Found in src/services/db/DbFillService.js and 1 other location - About 1 hr to fix
src/services/amazon/ACDSyncService.js on lines 266..272

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

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

            right_eye_status: {
              normal_glass_eye_open: row.eye_status_right_normal_glass_eye_open,
              no_glass_eye_close: row.eye_status_right_normal_glass_eye_close,
              occlusion: row.eye_status_right_occlusion,
              no_glass_eye_open: row.eye_status_right_no_glass_eye_open,
Severity: Major
Found in src/services/db/FacePPDbService.js and 1 other location - About 1 hr to fix
src/services/db/FacePPDbService.js on lines 668..676

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

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

        try {
          return this.psds.insert(psRow);
        } catch (e) {
          this.log.warn(e);
        } finally {
Severity: Major
Found in src/services/amazon/ACDSyncService.js and 1 other location - About 1 hr to fix
src/services/db/DbFillService.js on lines 110..116

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

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

            left_eye_status: {
              normal_glass_eye_open: row.eye_status_left_normal_glass_eye_open,
              no_glass_eye_close: row.eye_status_left_normal_glass_eye_close,
              occlusion: row.eye_status_left_occlusion,
              no_glass_eye_open: row.eye_status_left_no_glass_eye_open,
Severity: Major
Found in src/services/db/FacePPDbService.js and 1 other location - About 1 hr to fix
src/services/db/FacePPDbService.js on lines 677..685

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

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

export function drawMask(
  canvas: any,
  image: any,
  maskImage: any,
  maskOpacity: any,
Severity: Minor
Found in src/services/deepLearning/bodyPix/output_rendering_util.js - About 1 hr to fix

    Function deleteByHash has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      deleteByHash($hash: string): Promise<?any> {
        return new Promise((resolve, reject) => {
          if (!$hash) {
            resolve();
            return;
    Severity: Minor
    Found in src/services/db/TagDbService.js - About 1 hr to fix

      Function deleteByHash has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        deleteByHash($hash: string): Promise<?ProcessStateRow> {
          return new Promise((resolve, reject) => {
            if (!$hash) {
              resolve();
              return;
      Severity: Minor
      Found in src/services/db/ProcessStateDbService.js - About 1 hr to fix

        Function run has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async run() {
            let isError = false;
        
            this.registerErrorCallback();
        
        
        Severity: Minor
        Found in src/App.js - About 1 hr to fix

          Function deleteById has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            deleteById($id: string): Promise<?any> {
              return new Promise((resolve, reject) => {
                if (!$id) {
                  resolve();
                  return;
          Severity: Minor
          Found in src/services/db/ChannelDbService.js - About 1 hr to fix

            Function c has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            async function c() {
              console.log(
                "p-hash distance:",
                PHashService.compare(
                  await pHashService.calculate(argv[2]),
            Severity: Minor
            Found in bin/hdcalc.js - About 1 hr to fix

              Function collectBlockFiles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                async collectBlockFiles(targetPath?: string): Promise<string[]> {
                  const finalTargetPath = targetPath || this.fs.getSourcePath();
                  const csvString = await fs.readFile(finalTargetPath);
                  const results: FvcExport[] = await csv.parse(csvString, {
                    delimiter: ";",
              Severity: Minor
              Found in src/services/fs/fvc/FastVideoCatalogerService.js - About 1 hr to fix

                Function fillDeepLearningTable has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  fillDeepLearningTable(hitRows: HashRow[]): Promise<any> {
                    return Promise.all(
                      hitRows.map(async row => {
                        const fileInfo = DbService.rowToInfo(row, TYPE_IMAGE);
                        // TODO: version check?
                Severity: Minor
                Found in src/services/db/DbRepairService.js - About 1 hr to fix

                  Function searchAndGo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    searchAndGo(
                      type: ClassifyType = TYPE_IMAGE,
                      processLimit: number = 1
                    ): Promise<number> {
                      const limit = pLimit(this.config.maxWorkers);
                  Severity: Minor
                  Found in src/services/db/DbFillService.js - About 1 hr to fix

                    Function result has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          const result = await limitForPrepareFolder(async () => {
                            const directories = folderPath.replace(/(^\/|\/$)/g, "").split("/");
                            const fullPathDirectories = directories.map((d, i) => [
                              Array.from(Array(i + 1).keys()).map(j => directories[j]),
                              d
                    Severity: Minor
                    Found in src/services/amazon/ACDService.js - About 1 hr to fix

                      Function processAction has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        async processAction(
                          fileInfo: FileInfo,
                          result: JudgeResult
                        ): Promise<boolean> {
                          const [action, , reason, results] = result;
                      Severity: Minor
                      Found in src/services/ProcessService.js - About 1 hr to fix

                        Function onload has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                img.onload = async () => {
                                  const [c, ctx] = this.createCanvasAndContext(img.width, img.height);
                                  ctx.drawImage(img, 0, 0);
                                  // classify
                                  if (!net) {
                        Severity: Minor
                        Found in src/services/deepLearning/bodyPix/BodyPixService.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language