Genese complexity report

<- v8.d.ts
Methods : 26
Complexity index : 7.2
Cyclomatic complexity : 25
Cognitive complexity
100 % Correct 26/26
0 % Warning 0/26 (threshold : 10)
0 % Error 0/26 (threshold : 20)
Cyclomatic complexity
100 % Correct 26/26
0 % Warning 0/26 (threshold : 5)
0 % Error 0/26 (threshold : 10)
Methods of v8.d.ts
cachedDataVersionTag Complexity Index 0.1 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 * Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features.
                 * This is useful for determining whether a vm.Script cachedData buffer is compatible with this instance of V8.
                 */
                function cachedDataVersionTag(): number; // -------------------------------------------------------------------------------------------- +0.1 Complexity index (+0.1 atomic)
            
                            
                        
getHeapStatistics Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                
            
                function getHeapStatistics(): HeapInfo; // -------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
getHeapSpaceStatistics Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                
                function getHeapSpaceStatistics(): HeapSpaceInfo[]; // ------- +0.3 Complexity index (+0.3 atomic)
            
                            
                        
setFlagsFromString Complexity Index 0.4 Cyclomatic complexity 1
                            
                                
                
                function setFlagsFromString(flags: string): void; // --------- +0.4 Complexity index (+0.4 atomic)
            
                            
                        
getHeapSnapshot Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                
                /**
                 * Generates a snapshot of the current V8 heap and returns a Readable
                 * Stream that may be used to read the JSON serialized representation.
                 * This conversation was marked as resolved by joyeecheung
                 * This JSON stream format is intended to be used with tools such as
                 * Chrome DevTools. The JSON schema is undocumented and specific to the
                 * V8 engine, and may change from one version of V8 to the next.
                 */
                function getHeapSnapshot(): Readable; // ----------------------------------------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
writeHeapSnapshot Complexity Index 0.4 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 *
                 * @param fileName The file path where the V8 heap snapshot is to be
                 * saved. If not specified, a file name with the pattern
                 * `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
                 * generated, where `{pid}` will be the PID of the Node.js process,
                 * `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from
                 * the main Node.js thread or the id of a worker thread.
                 */
                function writeHeapSnapshot(fileName?: string): string; // --------------------------- +0.4 Complexity index (+0.4 atomic)
            
                            
                        
getHeapCodeStatistics Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                
            
                function getHeapCodeStatistics(): HeapCodeStatistics; // -------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
writeHeader Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                
                    /**
                     * Writes out a header, which includes the serialization format version.
                     */
                    writeHeader(): void; // ----------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
writeValue Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Serializes a JavaScript value and adds the serialized representation to the internal buffer.
                     * This throws an error if value cannot be serialized.
                     */
                    writeValue(val: any): boolean; // ------------------------------------------------------------------------ +0.3 Complexity index (+0.3 atomic)
            
                            
                        
releaseBuffer Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Returns the stored internal buffer.
                     * This serializer should not be used once the buffer is released.
                     * Calling this method results in undefined behavior if a previous write has failed.
                     */
                    releaseBuffer(): Buffer; // ------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
transferArrayBuffer Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Marks an ArrayBuffer as having its contents transferred out of band.\
                     * Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer().
                     */
                    transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; // ------------------------------------------------ +0.5 Complexity index (+0.5 atomic)
            
                            
                        
writeUint32 Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Write a raw 32-bit unsigned integer.
                     */
                    writeUint32(value: number): void; // -------------------------------------- +0.3 Complexity index (+0.3 atomic)
            
                            
                        
writeUint64 Complexity Index 0.4 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.
                     */
                    writeUint64(hi: number, lo: number): void; // ------------------------------------------ +0.4 Complexity index (+0.4 atomic)
            
                            
                        
writeDouble Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Write a JS number value.
                     */
                    writeDouble(value: number): void; // ---------------- +0.3 Complexity index (+0.3 atomic)
            
                            
                        
writeRawBytes Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Write raw bytes into the serializer’s internal buffer.
                     * The deserializer will require a way to compute the length of the buffer.
                     */
                    writeRawBytes(buffer: NodeJS.TypedArray): void; // ----------------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
Complexity Index 0.3 Cyclomatic complexity 0
                            
                                
                
                    constructor(data: NodeJS.TypedArray); // ------- +0.3 Complexity index (+0.3 atomic)
            
                            
                        
readHeader Complexity Index 0.1 Cyclomatic complexity 1
                            
                                
                    
                    /**
                     * Reads and validates a header (including the format version).
                     * May, for example, reject an invalid or unsupported wire format.
                     * In that case, an Error is thrown.
                     */
                    readHeader(): boolean; // --------------------------------------------------- +0.1 Complexity index (+0.1 atomic)
            
                            
                        
readValue Complexity Index 0.2 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Deserializes a JavaScript value from the buffer and returns it.
                     */
                    readValue(): any; // -------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
            
                            
                        
transferArrayBuffer Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Marks an ArrayBuffer as having its contents transferred out of band.
                     * Pass the corresponding `ArrayBuffer` in the serializing context to serializer.transferArrayBuffer()
                     * (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers).
                     */
                    transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; // --------------------------------------------- +0.5 Complexity index (+0.5 atomic)
            
                            
                        
getWireFormatVersion Complexity Index 0.1 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Reads the underlying wire format version.
                     * Likely mostly to be useful to legacy code reading old wire format versions.
                     * May not be called before .readHeader().
                     */
                    getWireFormatVersion(): number; // ------------------------------------------------------ +0.1 Complexity index (+0.1 atomic)
            
                            
                        
readUint32 Complexity Index 0.1 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Read a raw 32-bit unsigned integer and return it.
                     */
                    readUint32(): number; // -------------------------------------- +0.1 Complexity index (+0.1 atomic)
            
                            
                        
readUint64 Complexity Index 0.1 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries.
                     */
                    readUint64(): [number, number]; // ------------------------------------------------------------------------------------------ +0.1 Complexity index (+0.1 atomic)
            
                            
                        
readDouble Complexity Index 0.1 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Read a JS number value.
                     */
                    readDouble(): number; // ----------------- +0.1 Complexity index (+0.1 atomic)
            
                            
                        
readRawBytes Complexity Index 0.3 Cyclomatic complexity 1
                            
                                
                    
            
                    /**
                     * Read raw bytes from the deserializer’s internal buffer.
                     * The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes().
                     */
                    readRawBytes(length: number): Buffer; // ------------------------------------------------------------------------------------ +0.3 Complexity index (+0.3 atomic)
            
                            
                        
serialize Complexity Index 0.4 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 * Uses a `DefaultSerializer` to serialize value into a buffer.
                 */
                function serialize(value: any): Buffer; // ------------------------------- +0.4 Complexity index (+0.4 atomic)
            
                            
                        
deserialize Complexity Index 0.5 Cyclomatic complexity 1
                            
                                
                
            
                /**
                 * Uses a `DefaultDeserializer` with default options to read a JS value from a buffer.
                 */
                function deserialize(data: NodeJS.TypedArray): any; // ------------------------------------------ +0.5 Complexity index (+0.5 atomic)