leonitousconforti/tinyburg

View on GitHub

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;
Severity: Minor
Found in apps/trading-site/app/register/page.tsx - About 1 hr to fix

    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] = [];
            }
    
    
    Severity: Minor
    Found in packages/bitprints/src/fsm.ts - About 1 hr to fix

    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");
    Severity: Minor
    Found in packages/doorman/src/image-operations/mask-image.ts - About 1 hr to fix

    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
    Severity: Minor
    Found in packages/nucleus/src/compare-saves.ts - About 1 hr to fix

      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
      Severity: Minor
      Found in apps/authproxy/src/routes/v1/handler.ts - About 1 hr to fix

        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] = [];
                }
        
        
        Severity: Minor
        Found in packages/bitprints/src/fsm.ts - About 1 hr to fix

          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));
          Severity: Minor
          Found in packages/architect/src/docker-helpers/1-build-image.ts - About 1 hr to fix

            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">
            Severity: Minor
            Found in apps/trading-site/app/login/page.tsx - About 1 hr to fix

              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]
              Severity: Minor
              Found in packages/nucleus/src/modify-save.ts - About 1 hr to fix

                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';
                
                
                Severity: Minor
                Found in packages/insight/src/agents/get-mission-data.ts - About 1 hr to fix

                  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: {
                  Severity: Minor
                  Found in packages/insight/src/helpers/read.ts - About 1 hr to fix

                  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
                  Severity: Minor
                  Found in common/scripts/install-run.js - About 1 hr to fix

                    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,
                    Severity: Minor
                    Found in packages/doorman/src/image-operations/grayscale-image.ts - About 1 hr to fix

                      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;
                      Severity: Minor
                      Found in packages/bitprints/src/doubly-linked-list.ts - About 1 hr to fix

                        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> => {
                        Severity: Minor
                        Found in packages/nucleus/src/endpoints/upload-save.ts - About 55 mins to fix

                        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");
                            }
                        
                        
                        Severity: Minor
                        Found in packages/doorman/src/image-operations/upscale-image.ts - About 55 mins to fix

                        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> => {
                        Severity: Minor
                        Found in packages/nucleus/src/endpoints/friends.ts - About 55 mins to fix

                        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> => {
                        Severity: Minor
                        Found in packages/nucleus/src/endpoints/snapshots.ts - About 45 mins to fix

                        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...");
                        
                        
                        Severity: Minor
                        Found in packages/nucleus/src/endpoints/download-save.ts - About 45 mins to fix

                        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(
                        Severity: Major
                        Found in packages/nucleus/src/parsing-structs/parsing-subroutines.ts - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language