Genese complexity report

<- worker_threads.d.ts
Methods : 94
Complexity index : 58.4
Cyclomatic complexity : 93
Cognitive complexity
100 % Correct 94/94
0 % Warning 0/94 (threshold : 10)
0 % Error 0/94 (threshold : 20)
Cyclomatic complexity
100 % Correct 94/94
0 % Warning 0/94 (threshold : 5)
0 % Error 0/94 (threshold : 10)
Methods of worker_threads.d.ts
close Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                
                    close(): void; // ----------------------------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
postMessage Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    postMessage(value: any, transferList?: ReadonlyArray<TransferListItem>): void; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
ref Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                    
                    ref(): void; // ------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
unref Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                    
                    unref(): void; // ------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
start Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                    
                    start(): void; // ------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
addListener Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    addListener(event: "close", listener: () => void): this; // ------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
addListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    addListener(event: "message", listener: (value: any) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
addListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    addListener(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
addListener Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    addListener(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
emit Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                    
            
                    emit(event: "close"): boolean; // ------------------------------------------------------- +0.3 Complexity index (+0.3 atomic)
            
                            
                        
emit Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    emit(event: "message", value: any): boolean; // ------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
emit Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    emit(event: "messageerror", error: Error): boolean; // ------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
emit Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    emit(event: string | symbol, ...args: any[]): boolean; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
on Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    on(event: "close", listener: () => void): this; // -------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
on Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    on(event: "message", listener: (value: any) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
on Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    on(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
on Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    on(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
once Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    once(event: "close", listener: () => void): this; // --------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
once Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    once(event: "message", listener: (value: any) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
once Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    once(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
once Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    once(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
prependListener Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    prependListener(event: "close", listener: () => void): this; // ------------------ +0.5 Complexity index (+0.5 atomic)
            
                            
                        
prependListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    prependListener(event: "message", listener: (value: any) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    prependListener(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependListener Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    prependListener(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    prependOnceListener(event: "close", listener: () => void): this; // ------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    prependOnceListener(event: "message", listener: (value: any) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    prependOnceListener(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
removeListener Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    removeListener(event: "close", listener: () => void): this; // ---------------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
removeListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    removeListener(event: "message", listener: (value: any) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
removeListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    removeListener(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
removeListener Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    removeListener(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
off Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    off(event: "close", listener: () => void): this; // ---------------------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
off Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    off(event: "message", listener: (value: any) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
off Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    off(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
off Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    off(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
Complexity Index 0.6 Cyclomatic complexity 0
                            
                                
                    
            
                    /**
                     * @param filename  The path to the Worker’s main script or module.
                     *                  Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with ./ or ../,
                     *                  or a WHATWG URL object using file: protocol. If options.eval is true, this is a string containing JavaScript code rather than a path.
                     */
                    constructor(filename: string | URL, options?: WorkerOptions); // --------------------------------------------------------------------------------------------------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
postMessage Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
            
                    postMessage(value: any, transferList?: ReadonlyArray<TransferListItem>): void; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
ref Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                    
                    ref(): void; // ------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
unref Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                    
                    unref(): void; // ------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
terminate Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                    
                    /**
                     * Stop all JavaScript execution in the worker thread as soon as possible.
                     * Returns a Promise for the exit code that is fulfilled when the `exit` event is emitted.
                     */
                    terminate(): Promise<number>; // -------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
getHeapSnapshot Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Returns a readable stream for a V8 snapshot of the current state of the Worker.
                     * See [`v8.getHeapSnapshot()`][] for more details.
                     *
                     * If the Worker thread is no longer running, which may occur before the
                     * [`'exit'` event][] is emitted, the returned `Promise` will be rejected
                     * immediately with an [`ERR_WORKER_NOT_RUNNING`][] error
                     */
                    getHeapSnapshot(): Promise<Readable>; // ---------------------------------------------------- +0.3 Complexity index (+0.3 atomic)
            
                            
                        
addListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
            
                    addListener(event: "error", listener: (err: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
addListener Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                    
                    addListener(event: "exit", listener: (exitCode: number) => void): this; // ------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
addListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    addListener(event: "message", listener: (value: any) => void): this; // ---------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
addListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    addListener(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
addListener Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    addListener(event: "online", listener: () => void): this; // ------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
addListener Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    addListener(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
emit Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    emit(event: "error", err: Error): boolean; // ------------------------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
emit Complexity Index 0.4 Cyclomatic complexity 1
                            
                                
                    
                    emit(event: "exit", exitCode: number): boolean; // ------- +0.4 Complexity index (+0.4 atomic)
            
                            
                        
emit Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    emit(event: "message", value: any): boolean; // ---------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
emit Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    emit(event: "messageerror", error: Error): boolean; // ------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
emit Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                    
                    emit(event: "online"): boolean; // --------------------------- +0.3 Complexity index (+0.3 atomic)
            
                            
                        
emit Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    emit(event: string | symbol, ...args: any[]): boolean; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
on Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
            
                    on(event: "error", listener: (err: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
on Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                    
                    on(event: "exit", listener: (exitCode: number) => void): this; // ------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
on Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    on(event: "message", listener: (value: any) => void): this; // ---------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
on Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    on(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
on Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    on(event: "online", listener: () => void): this; // ------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
on Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    on(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
once Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
            
                    once(event: "error", listener: (err: Error) => void): this; // ----------------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
once Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                    
                    once(event: "exit", listener: (exitCode: number) => void): this; // ------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
once Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    once(event: "message", listener: (value: any) => void): this; // ---------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
once Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    once(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
once Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    once(event: "online", listener: () => void): this; // ------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
once Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    once(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
prependListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
            
                    prependListener(event: "error", listener: (err: Error) => void): this; // -------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependListener Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                    
                    prependListener(event: "exit", listener: (exitCode: number) => void): this; // ------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
prependListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    prependListener(event: "message", listener: (value: any) => void): this; // ---------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    prependListener(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependListener Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    prependListener(event: "online", listener: () => void): this; // ------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
prependListener Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    prependListener(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
            
                    prependOnceListener(event: "error", listener: (err: Error) => void): this; // --------------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                    
                    prependOnceListener(event: "exit", listener: (exitCode: number) => void): this; // ------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    prependOnceListener(event: "message", listener: (value: any) => void): this; // ---------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    prependOnceListener(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    prependOnceListener(event: "online", listener: () => void): this; // ------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
prependOnceListener Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
removeListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
            
                    removeListener(event: "error", listener: (err: Error) => void): this; // ------------------------ +0.7 Complexity index (+0.7 atomic)
            
                            
                        
removeListener Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                    
                    removeListener(event: "exit", listener: (exitCode: number) => void): this; // ------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
removeListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    removeListener(event: "message", listener: (value: any) => void): this; // ---------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
removeListener Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    removeListener(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
removeListener Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    removeListener(event: "online", listener: () => void): this; // ------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
removeListener Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    removeListener(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
off Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
            
                    off(event: "error", listener: (err: Error) => void): this; // ------------------------------ +0.7 Complexity index (+0.7 atomic)
            
                            
                        
off Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                    
                    off(event: "exit", listener: (exitCode: number) => void): this; // ------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
off Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    off(event: "message", listener: (value: any) => void): this; // ---------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
off Complexity Index 0.7 Cyclomatic complexity 1
                            
                                
                    
                    off(event: "messageerror", listener: (error: Error) => void): this; // ------- +0.7 Complexity index (+0.7 atomic)
            
                            
                        
off Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
                    off(event: "online", listener: () => void): this; // ------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
off Complexity Index 0.9 Cyclomatic complexity 1
                            
                                
                    
                    off(event: string | symbol, listener: (...args: any[]) => void): this; // ------- +0.9 Complexity index (+0.9 atomic)
            
                            
                        
markAsUntransferable Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 * Mark an object as not transferable.
                 * If `object` occurs in the transfer list of a `port.postMessage()` call, it will be ignored.
                 *
                 * In particular, this makes sense for objects that can be cloned, rather than transferred,
                 * and which are used by other objects on the sending side. For example, Node.js marks
                 * the `ArrayBuffer`s it uses for its Buffer pool with this.
                 *
                 * This operation cannot be undone.
                 */
                function markAsUntransferable(object: object): void; // ------------------------------------------------- +0.3 Complexity index (+0.3 atomic)
            
                            
                        
moveMessagePortToContext Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 * Transfer a `MessagePort` to a different `vm` Context. The original `port`
                 * object will be rendered unusable, and the returned `MessagePort` instance will
                 * take its place.
                 *
                 * The returned `MessagePort` will be an object in the target context, and will
                 * inherit from its global `Object` class. Objects passed to the
                 * `port.onmessage()` listener will also be created in the target context
                 * and inherit from its global `Object` class.
                 *
                 * However, the created `MessagePort` will no longer inherit from
                 * `EventEmitter`, and only `port.onmessage()` can be used to receive
                 * events using it.
                 */
                function moveMessagePortToContext(port: MessagePort, context: Context): MessagePort; // ------- +0.6 Complexity index (+0.6 atomic)
            
                            
                        
receiveMessageOnPort Complexity Index 0.6 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 * Receive a single message from a given `MessagePort`. If no message is available,
                 * `undefined` is returned, otherwise an object with a single `message` property
                 * that contains the message payload, corresponding to the oldest message in the
                 * `MessagePort`’s queue.
                 */
                function receiveMessageOnPort(port: MessagePort): { message: any } | undefined; // ------------ +0.6 Complexity index (+0.6 atomic)