Genese complexity report

<- hyper-complex.mock.ts
Methods : 3
Complexity index : 36.4
Cyclomatic complexity : 5
Cognitive complexity
66.7 % Correct 2/3
0 % Warning 0/3 (threshold : 10)
33.3 % Error 1/3 (threshold : 20)
Cyclomatic complexity
100 % Correct 3/3
0 % Warning 0/3 (threshold : 5)
0 % Error 0/3 (threshold : 10)
Methods of hyper-complex.mock.ts
hyperComplex Complexity Index 23.7 Cyclomatic complexity 1
                            
                                
            
            
            
                hyperComplex<T>(object: Object, path: string | string[] = '', value: any): CallbacksMock<T> { // ------- +1.4 Complexity index (+1.4 atomic)
                    path = path.toString().match(/[^.[\]]+/g); // ------------------------------------------------------ +4.5 Complexity index (+0.6 atomic, +0.9 aggregation, +3 structural)
                    path.slice(0, -1).reduce((acc: any, curr: any, index: number) => { // ------------------------------ +9.2 Complexity index (+1.2 atomic, +2 recursivity, +3 structural, +3 use)
                        const arg = Math.round(index) % 3; // ---------------------------------------------------------- +1.7 Complexity index (+0.7 atomic, +1 structural)
                        acc(0); // ------------------------------------------------------------------------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return Object(acc[curr]) === acc[curr + arg][0]; // -------------------------------------------- +3.0 Complexity index (+1.0 atomic, +1 aggregation, +1 structural)
                    }, object)[path[path.length - 1]] = value; // ------------------------------------------------------ +2.2 Complexity index (+0.7 atomic, +1.5 depth)
                    return new CallbacksMock<T>(object); // ------------------------------------------------------------ +0.5 Complexity index (+0.5 atomic)
                }
            
                            
                        
ifIf Complexity Index 4.1 Cyclomatic complexity 3
                            
                                
                
            
            
                ifIf(data) { // ---------------------- +0.2 Complexity index (+0.2 atomic)
                    if (data === 'a') { // ----------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        data = 'b'; // --------------- +0.3 Complexity index (+0.3 atomic)
                        if (data === 'v') { // ------- +1.9 Complexity index (+0.4 atomic, +0.5 nesting, +1 structural)
                            data = 'c'; // ----------- +0.3 Complexity index (+0.3 atomic)
                        }
                    }
                }
            
                            
                        
reducer Complexity Index 8.6 Cyclomatic complexity 1
                            
                                
                
            
            
                reducer(acc: Object, curr: any, index: number, path: number) { // -------------------------------------------------- +0.7 Complexity index (+0.7 atomic)
                    return Object(acc[curr]) === acc[curr] ? acc[curr] : (acc[curr] = isNaN(+path[index + 1]) ? {} : []); // ------- +7.9 Complexity index (+1.9 atomic, +2 nesting, +4 structural)
                }