Showing 100 of 824 total issues
Avoid deeply nested control flow statements. Open
Open
if (!process.env[environmentVariableName]) {
// No, so trim this line
lineShouldBeTrimmed = true;
break;
}
Avoid deeply nested control flow statements. Open
Open
if (mask && mask.pixels[t_y * mask.width + t_x] < 255) {
continue;
}
Function installAndRun
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function installAndRun(logger, packageName, packageVersion, packageBinName, packageBinArgs, lockFilePath = process.env[INSTALL_RUN_LOCKFILE_PATH_VARIABLE]) {
Avoid deeply nested control flow statements. Open
Open
if (SAD > 0 && wantExact) {
exact = false;
break;
}
Function _installPackage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function _installPackage(logger, packageInstallFolder, name, version, command) {
Function modifySave
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
>(saveDataToModify: T, keys: U, values: V, forceLoadStructs: boolean = false, logger: ILogger = debug): Promise<T> {
Function sendItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
export const sendItem = async (
config: IConfig,
{ itemType, sendTo, item }: SendItemParameters,
logger: ILogger = debug
): Promise<ISendItem> => {
- 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 grayscaleImage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
export const grayscaleImage = (sourceImage: Image): Image => {
sourceImageGuard(sourceImage);
assert(sourceImage.channels === 3, "Source image must have three channels");
assert(
sourceImage.format === ImageType.RGB || sourceImage.format === ImageType.BGR,
- 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
Avoid too many return
statements within this function. Open
Open
return (field as Il2Cpp.Field<Il2Cpp.ValueType>).value.toString();
Avoid too many return
statements within this function. Open
Open
return logger.fatal(new Error("Hash verification failed when checking for newer save"));
Avoid too many return
statements within this function. Open
Open
return logger.fatal(new Error("Bad server response"));
Avoid too many return
statements within this function. Open
Open
return 2;
Avoid too many return
statements within this function. Open
Open
return string;
Avoid too many return
statements within this function. Open
Open
return 2;
Avoid too many return
statements within this function. Open
Open
return logger.fatal(new Error("Bad server response"));
Avoid too many return
statements within this function. Open
Open
return (object as unknown as Il2Cpp.ValueType).toString();
Avoid too many return
statements within this function. Open
Open
return Object.fromEntries(entries);
Avoid too many return
statements within this function. Open
Open
return logger.fatal(new Error("Bad server response"));
Avoid too many return
statements within this function. Open
Open
return undefined;
Avoid too many return
statements within this function. Open
Open
return (field as Il2Cpp.Field<Il2Cpp.String>).value.content!;