packages/insight/src/helpers/read.ts
Function readObject
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const readObject = (
object: Il2Cpp.Object
): boolean | number | string | NativePointer | unknown[] | undefined => {
switch (object.class.type.typeEnum) {
case Il2Cpp.Type.enum.void: {
Function readField
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const readField = (field: Il2Cpp.Field): string | number | boolean | NativePointer | undefined | unknown[] => {
switch (field.type.typeEnum) {
case Il2Cpp.Type.enum.void: {
return undefined;
}
Function readObject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
export const readObject = (
object: Il2Cpp.Object
): boolean | number | string | NativePointer | unknown[] | undefined => {
switch (object.class.type.typeEnum) {
case Il2Cpp.Type.enum.void: {
- 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 string;
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 undefined;
Avoid too many return
statements within this function. Open
Open
return (field as Il2Cpp.Field<Il2Cpp.String>).value.content!;
Avoid too many return
statements within this function. Open
Open
return copyArrayToJs(object as unknown as Il2Cpp.Array<Il2Cpp.Object>).map((value) => readObject(value));
Avoid too many return
statements within this function. Open
Open
return copyListToJs<Il2Cpp.Object>(object).map((value) => readObject(value));
Avoid too many return
statements within this function. Open
Open
return undefined;
Avoid too many return
statements within this function. Open
Open
return undefined;
Avoid too many return
statements within this function. Open
Open
if (string === "") return "__Empty String__";
Avoid too many return
statements within this function. Open
Open
return undefined;