Showing 119 of 303 total issues
Avoid too many return
statements within this function. Open
Open
return this.rl.logResult(fileInfo, [
TYPE_REPLACE,
(await this.detectReplaceFile(fileInfo, storedFileInfoByPHashs)) ||
storedFileInfoByPHashs[0],
TYPE_FILE_MARK_REPLACE
Avoid too many return
statements within this function. Open
Open
return new Set([MARK_ERASE]);
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
return this.rl.logResult(fileInfo, [
TYPE_DELETE,
null,
TYPE_FILE_MARK_ERASE
]);
Avoid too many return
statements within this function. Open
Open
return this.rl.logResult(fileInfo, [
TYPE_SAVE,
null,
TYPE_FILE_MARK_SAVE
]);
Avoid too many return
statements within this function. Open
Open
return this.rl.logResult(fileInfo, [
TYPE_SAVE,
null,
TYPE_FILE_MARK_SAVE
]);
Avoid too many return
statements within this function. Open
Open
return new Set([]);
Avoid too many return
statements within this function. Open
Open
return this.rl.logResult(fileInfo, [
TYPE_REPLACE,
storedFileInfoByNames[0],
TYPE_FILE_MARK_REPLACE
]);
Avoid too many return
statements within this function. Open
Open
return judgeResult;
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
Avoid too many return
statements within this function. Open
Open
return this.rl.logResult(fileInfo, [
TYPE_SAVE,
null,
TYPE_FILE_MARK_SAVE
]);
Avoid too many return
statements within this function. Open
Open
return null;
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
return this.rl.logResult(fileInfo, [
this.al.fixAction(!this.config.instantDelete, TYPE_DELETE),
null,
deleteReason
]);
Avoid too many return
statements within this function. Open
Open
return this.rl.logResult(fileInfo, [
this.config.deepLearningConfig.instantDelete
? TYPE_DELETE
: TYPE_HOLD,
null,
Avoid too many return
statements within this function. Open
Open
return this.pl.handleNameHit(fileInfo, storedFileInfoByNames);
Function default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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);
- Read upRead up
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 detectFileTypeReasonAndAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
async detectFileTypeReasonAndAction(
fileInfo: FileInfo
): Promise<?[ReasonType, ActionType]> {
if (fileInfo.type === TYPE_UNKNOWN) {
return [TYPE_UNKNOWN_FILE_TYPE, TYPE_HOLD];
- Read upRead up
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"