Showing 100 of 824 total issues
Function Login
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Login() {
async function register(formData: FormData) {
"use server";
let email = formData.get("email") as string;
let password = formData.get("password") as string;
Function _transitionTo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private async _transitionTo(state: State, data: EventData): Promise<EventData | undefined> {
if (!this._exitCallbacks[this._currentState]) {
this._exitCallbacks[this._currentState] = [];
}
- 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 maskImage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const maskImage = (sourceImage: Image, mask: Image, threshold: number, crop = false): Image => {
sourceImageGuard(mask);
sourceImageGuard(sourceImage);
uint8safeIntegerGuard(threshold);
assert(mask.channels === 1, "Mask image must have exactly one channel");
- 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 whichSaveIsBetter
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const whichSaveIsBetter = async function <T extends INimblebitJsonSave | DecompressedSave>(
save1: T,
save2: T,
forceLoadStructs: boolean = false,
logger: ILogger = debug
Function handler
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const handler = async function (request: Request, reply: Reply): Promise<void> {
request.log.debug({ req: request }, "handler hook fired");
const { playerId, salt, playerSs, finalUrl, endpoint } = request.nimblebitData;
// Make the request
Function _transitionTo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async _transitionTo(state: State, data: EventData): Promise<EventData | undefined> {
if (!this._exitCallbacks[this._currentState]) {
this._exitCallbacks[this._currentState] = [];
}
Function buildImage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Effect.gen(function* () {
const images: MobyApi.Images.Images = yield* MobyApi.Images.Images;
const context: url.URL = new URL("../../emulator", import.meta.url);
const tarStream: tar.Pack = tar.pack(url.fileURLToPath(context));
Function Login
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Login() {
return (
<div className="flex h-screen w-screen items-center justify-center bg-gray-50">
<div className="z-10 w-full max-w-md overflow-hidden rounded-2xl border border-gray-100 shadow-xl">
<div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 py-6 pt-8 text-center sm:px-16">
Function modifySave
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const modifySave = async function <
T extends INimblebitJsonSave | DecompressedSave,
U extends keyof INimblebitJsonSave | (readonly [] | readonly (keyof INimblebitJsonSave)[]),
V extends U extends keyof INimblebitJsonSave
? INimblebitJsonSave[U]
Function transformToSourceCode
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public transformToSourceCode() {
// Import for the floor type enum
// eslint-disable-next-line quotes
const floorTypeEnumImport = 'import { FloorType } from "./floors.js";\n';
Function readObject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. 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
Function syncNpmrc
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function syncNpmrc(options) {
const { sourceNpmrcFolder, targetNpmrcFolder, useNpmrcPublish, logger = {
// eslint-disable-next-line no-console
info: console.log,
// eslint-disable-next-line no-console
Function grayscaleImage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. 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,
Function quicksort
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const quicksort = (start: LinkedListNode<NodeData>, end: LinkedListNode<NodeData>): void => {
if (start === end) return;
const pivotData = end.data;
let current: LinkedListNode<NodeData> | undefined = start;
Function uploadSave
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const uploadSave = async (
config: IConfig,
{ saveData, version, language, platform, forcePush = false }: UploadSaveParameters,
logger: ILogger = debug
): Promise<IUploadSave> => {
- 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 upscaleImage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const upscaleImage = (sourceImage: Image, scale: number): Image => {
if (!Number.isInteger(scale) || scale < 1) {
throw new Error("Invalid scale factor");
}
- 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 pullFriendTower
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const pullFriendTower = async (
config: IConfig,
{ friendId }: IPullFriendParameters,
logger: ILogger = debug
): Promise<DecompressedSave> => {
- 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 pullSnapshot
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const pullSnapshot = async (
config: IConfig,
{ snapshotId }: PullSnapshotParameters,
logger: ILogger = debug
): Promise<DecompressedSave> => {
- 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 downloadSave
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const downloadSave = async (config: IConfig, logger: ILogger = debug): Promise<DecompressedSave> => {
// Setup logging
const passLogger = logger === debug ? undefined : logger;
logger.info("Starting download of current cloud save data...");
- 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 deeply nested control flow statements. Open
if (Array.isArray(nextBlocksToUse)) {
(nimblebitJsonSave[nameOfBlock] as unknown as Record<string, unknown>)[nextBlocksToUse[index]] =
piece;
} else {
const more = parsingSubRoutine(