wkdhkr/dedupper

View on GitHub

Showing 119 of 303 total issues

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

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

      /* eslint-disable no-plusplus */
      /* eslint-disable camelcase */
      // @flow
      import typeof { Logger } from "log4js";
      import { STATE_ACCEPTED, STATE_KEEPING } from "../../types/FileStates";
      Severity: Major
      Found in src/services/db/FacePPDbService.js - About 2 days to fix

        File defaultConfig.js has 604 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // @flow
        import path from "path";
        import os from "os";
        
        import EnvironmentHelper from "./helpers/EnvironmentHelper";
        Severity: Major
        Found in src/defaultConfig.js - About 1 day to fix

          File DbService.js has 548 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // @flow
          import fs from "fs-extra";
          import path from "path";
          
          import typeof { Logger } from "log4js";
          Severity: Major
          Found in src/services/db/DbService.js - About 1 day to fix

            File ACDService.js has 528 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // @flow
            // import sleep from "await-sleep";
            import pLimit from "p-limit";
            import { wrapper } from "axios-cookiejar-support";
            import FormData from "form-data";
            Severity: Major
            Found in src/services/amazon/ACDService.js - About 1 day to fix

              File ProcessService.js has 495 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // @flow
              import maxListenersExceededWarning from "max-listeners-exceeded-warning";
              import events from "events";
              import typeof { Logger } from "log4js";
              import pLimit from "p-limit";
              Severity: Minor
              Found in src/services/ProcessService.js - About 7 hrs to fix

                File index.js has 416 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // @flow
                import type { DeleteModeType } from "./DeleteModeTypes";
                import type { ClassifyType } from "./ClassifyTypes";
                import type { FileState } from "./FileStates";
                import type { ReasonType } from "./ReasonTypes";
                Severity: Minor
                Found in src/types/index.js - About 6 hrs to fix

                  File BodyPixService.js has 400 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // @flow
                  /**
                   * @license
                   * Copyright 2019 Google Inc. All Rights Reserved.
                   * Licensed under the Apache License, Version 2.0 (the "License");
                  Severity: Minor
                  Found in src/services/deepLearning/bodyPix/BodyPixService.js - About 5 hrs to fix

                    File FacePPService.js has 378 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // @flow
                    // import cv from "opencv4nodejs-prebuilt";
                    import qs from "qs";
                    import axiosRetry from "axios-retry";
                    import axios from "axios";
                    Severity: Minor
                    Found in src/services/deepLearning/facePP/FacePPService.js - About 5 hrs to fix

                      File FileService.js has 376 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // @flow
                      import waitOn from "wait-on";
                      import { exec } from "child-process-promise";
                      import sleep from "await-sleep";
                      import mv from "mv";
                      Severity: Minor
                      Found in src/services/fs/FileService.js - About 5 hrs to fix

                        Function default has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function(config: Config): any {
                          const router = express.Router();
                          const log = log4js.getLogger("sqliteAll");
                          const ds = new DbService(config);
                          const tds = new TagDbService(config);
                        Severity: Major
                        Found in src/servers/routes/sqliteAllRoute.js - About 4 hrs to fix

                          Function handleFileNameMark has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            async handleFileNameMark(
                              fileInfo: FileInfo,
                              storedFileInfoByHash: ?HashRow,
                              storedFileInfoByPHashs: HashRow[],
                              storedFileInfoByNames: HashRow[],
                          Severity: Major
                          Found in src/services/judgment/PathLogic.js - About 3 hrs to fix

                            ProcessService has 29 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            export default class ProcessService {
                              log: Logger;
                            
                              config: Config;
                            
                            
                            Severity: Minor
                            Found in src/services/ProcessService.js - About 3 hrs to fix

                              ACDService has 28 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              export default class ACDService {
                                lock: (name: string) => any = (name: string) => LockHelper.lockProcess(name);
                              
                                unlock: (name: string) => Promise<void> = (name: string) =>
                                  LockHelper.unlockProcess(name);
                              Severity: Minor
                              Found in src/services/amazon/ACDService.js - About 3 hrs to fix

                                AttributeService has 28 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                export default class AttributeService {
                                  log: typeof Logger;
                                
                                  config: Config;
                                
                                
                                Severity: Minor
                                Found in src/services/fs/AttributeService.js - About 3 hrs to fix

                                  Function classifyTypeByExtension has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    classifyTypeByExtension: (() => {
                                      const lookup = {};
                                      const assignFn = (ext, type) => {
                                        lookup[ext] = type;
                                      };
                                  Severity: Major
                                  Found in src/defaultConfig.js - About 3 hrs to fix

                                    Function queryByPHash has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      queryByPHash({
                                        p_hash: pHash,
                                        d_hash: dHash,
                                        from_path: fromPath,
                                        type,
                                    Severity: Major
                                    Found in src/services/db/DbService.js - About 3 hrs to fix

                                      File PHashLogic.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      // @flow
                                      import typeof { Logger } from "log4js";
                                      
                                      import AttributeService from "../fs/AttributeService";
                                      import DbService from "../db/DbService";
                                      Severity: Minor
                                      Found in src/services/judgment/PHashLogic.js - About 3 hrs to fix

                                        File NsfwJsDbService.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open

                                        // @flow
                                        import typeof { Logger } from "log4js";
                                        import { STATE_ACCEPTED, STATE_KEEPING } from "../../types/FileStates";
                                        import SQLiteService from "./SQLiteService";
                                        import { TYPE_IMAGE } from "../../types/ClassifyTypes";
                                        Severity: Minor
                                        Found in src/services/db/NsfwJsDbService.js - About 3 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language