src/services/judgment/PHashLogic.js
File PHashLogic.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @flow
import typeof { Logger } from "log4js";
import AttributeService from "../fs/AttributeService";
import DbService from "../db/DbService";
Function factors
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
storedFileInfos.map(async info => {
let isSameDir = false;
let isAccessible = false;
if (this.as.isSameDir(info.from_path)) {
isSameDir = true;
Function results
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const results = factors.map((factor): JudgeResultSimple => {
this.log.trace(JSON.stringify(factor, null, 2));
if (factor.isValidDistance === false) {
return [TYPE_HOLD, factor.info, TYPE_PROCESS_ERROR];
}
Avoid too many return
statements within this function. Open
Open
return [this.al.fixAction(isMayBe, action), hitRow, reason];
Avoid too many return
statements within this function. Open
Open
return this.fixPHashHitResult(
[TYPE_REPLACE, factor.info, TYPE_P_HASH_MATCH],
factor.isMayBe,
factor.isWillKeep,
factor.isKeeping