Genese complexity report

<- if.mock.ts
Methods : 17
Complexity index : 100.1
Cyclomatic complexity : 61
Cognitive complexity
88.2 % Correct 15/17
11.8 % Warning 2/17 (threshold : 10)
0 % Error 0/17 (threshold : 20)
Cyclomatic complexity
88.2 % Correct 15/17
11.8 % Warning 2/17 (threshold : 5)
0 % Error 0/17 (threshold : 10)
Methods of if.mock.ts
Complexity Index 0 Cyclomatic complexity 0
                            
                                
            
            
                constructor() {
                }
            
                            
                        
ifAlone Complexity Index 1.6 Cyclomatic complexity 2
                            
                                
                
            
            
                // @ts-ignore
                ifAlone(a) { // -------------- +0.2 Complexity index (+0.2 atomic)
                    if (a) { // -------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 'b'; // ------- +0.2 Complexity index (+0.2 atomic)
                    }
                }
            
                            
                        
ifElse Complexity Index 2.9 Cyclomatic complexity 2
                            
                                
                
            
            
                ifElse(a) { // --------------- +0.2 Complexity index (+0.2 atomic)
                    if (a) { // -------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 'b'; // ------- +0.2 Complexity index (+0.2 atomic)
                    } else { // -------------- +1.1 Complexity index (+0.1 atomic, +1 structural)
                        return 'c'; // ------- +0.2 Complexity index (+0.2 atomic)
                    }
                }
            
                            
                        
ifIfNested Complexity Index 3.6 Cyclomatic complexity 3
                            
                                
                
            
            
                // @ts-ignore
                ifIfNested(a, b) { // ------------ +0.3 Complexity index (+0.3 atomic)
                    if (a) { // ------------------ +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 'b'; // ----------- +0.2 Complexity index (+0.2 atomic)
                        if (b) { // -------------- +1.7 Complexity index (+0.2 atomic, +0.5 nesting, +1 structural)
                            return 'c'; // ------- +0.2 Complexity index (+0.2 atomic)
                        }
                    }
                }
            
                            
                        
ifElseIfElse Complexity Index 4.4 Cyclomatic complexity 3
                            
                                
                
            
            
                ifElseIfElse(a, b) { // ------- +0.3 Complexity index (+0.3 atomic)
                    if (a) { // --------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 'b'; // -------- +0.2 Complexity index (+0.2 atomic)
                    } else if (b) { // -------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 'c'; // -------- +0.2 Complexity index (+0.2 atomic)
                    } else { // --------------- +1.1 Complexity index (+0.1 atomic, +1 structural)
                        return 'c'; // -------- +0.2 Complexity index (+0.2 atomic)
                    }
                }
            
                            
                        
ifElseIfIfElse Complexity Index 6.2 Cyclomatic complexity 4
                            
                                
                
            
            
                // @ts-ignore
                ifElseIfIfElse(a, b, c) { // ------- +0.4 Complexity index (+0.4 atomic)
                    if (a) { // -------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 1; // --------------- +0.2 Complexity index (+0.2 atomic)
                    } else if (b) { // ------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        if (c) { // ---------------- +1.7 Complexity index (+0.2 atomic, +0.5 nesting, +1 structural)
                            return 0; // ----------- +0.2 Complexity index (+0.2 atomic)
                        }
                    } else { // -------------------- +1.1 Complexity index (+0.1 atomic, +1 structural)
                        return 2; // --------------- +0.2 Complexity index (+0.2 atomic)
                    }
                }
            
                            
                        
ifElseIfInside Complexity Index 4.7 Cyclomatic complexity 3
                            
                                
                
            
            
                // @ts-ignore
                ifElseIfInside(a, b) { // -------- +0.3 Complexity index (+0.3 atomic)
                    if (a) { // ------------------ +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 'b'; // ----------- +0.2 Complexity index (+0.2 atomic)
                    } else { // ------------------ +1.1 Complexity index (+0.1 atomic, +1 structural)
                        if (b) { // -------------- +1.7 Complexity index (+0.2 atomic, +0.5 nesting, +1 structural)
                            return 'c'; // ------- +0.2 Complexity index (+0.2 atomic)
                        }
                    }
                }
            
                            
                        
ifNestedIf Complexity Index 3.7 Cyclomatic complexity 3
                            
                                
                
            
            
                // @ts-ignore
                ifNestedIf(a) { // ---------------- +0.2 Complexity index (+0.2 atomic)
                    if (a) { // ------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 'b'; // ------------ +0.2 Complexity index (+0.2 atomic)
                        if (a === 'v') { // ------- +1.9 Complexity index (+0.4 atomic, +0.5 nesting, +1 structural)
                            return 'c'; // -------- +0.2 Complexity index (+0.2 atomic)
                        }
                    }
                }
            
                            
                        
ifIfElseInside Complexity Index 5 Cyclomatic complexity 3
                            
                                
                
            
            
            
                // @ts-ignore
                ifIfElseInside(a) { // ------------ +0.2 Complexity index (+0.2 atomic)
                    if (a) { // ------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return 'b'; // ------------ +0.2 Complexity index (+0.2 atomic)
                        if (a === 'v') { // ------- +1.9 Complexity index (+0.4 atomic, +0.5 nesting, +1 structural)
                            return 'c'; // -------- +0.2 Complexity index (+0.2 atomic)
                        } else { // --------------- +1.1 Complexity index (+0.1 atomic, +1 structural)
                            return 'f'; // -------- +0.2 Complexity index (+0.2 atomic)
                        }
                    }
                }
            
                            
                        
ifAnd Complexity Index 4.1 Cyclomatic complexity 3
                            
                                
                
            
            
                ifAnd(a, b) { // ----------------- +0.3 Complexity index (+0.3 atomic)
                    if (a && b) { // ------------- +2.5 Complexity index (+0.5 atomic, +2 structural)
                        console.log(a); // ------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    }
                }
            
                            
                        
ifOr Complexity Index 4.1 Cyclomatic complexity 3
                            
                                
                
            
            
                ifOr(a, b) { // ------------------ +0.3 Complexity index (+0.3 atomic)
                    if (a || b) { // ------------- +2.5 Complexity index (+0.5 atomic, +2 structural)
                        console.log(a); // ------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    }
                }
            
                            
                        
ifAndAnd Complexity Index 5.5 Cyclomatic complexity 4
                            
                                
                
            
            
                ifAndAnd(a, b, c) { // ----------- +0.4 Complexity index (+0.4 atomic)
                    if (a && b && c) { // -------- +3.8 Complexity index (+0.8 atomic, +3 structural)
                        console.log(a); // ------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    }
                }
            
                            
                        
ifAndOr Complexity Index 7.5 Cyclomatic complexity 4
                            
                                
                
            
            
                ifAndOr(a, b, c) { // ------------ +0.4 Complexity index (+0.4 atomic)
                    if (a && b || c) { // -------- +5.8 Complexity index (+0.8 atomic, +2 aggregation, +3 structural)
                        console.log(a); // ------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    }
                }
            
                            
                        
ifAndAndOrAnd Complexity Index 13.7 Cyclomatic complexity 7
                            
                                
                
            
            
                ifAndAndOrAnd(a, b, c, d, e, f) { // ----------- +0.7 Complexity index (+0.7 atomic)
                    if (a && b && c || d && e && f) { // ------- +11.7 Complexity index (+1.7 atomic, +4 aggregation, +6 structural)
                        console.log(a); // --------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    }
                }
            
                            
                        
ifAndAndOrAndAndOrOr Complexity Index 16.3 Cyclomatic complexity 9
                            
                                
                
            
            
                ifAndAndOrAndAndOrOr(a, b, c, d, e, f) { // -------------- +0.7 Complexity index (+0.7 atomic)
                    if (a && b && c || d && e && f || a || b) { // ------- +14.3 Complexity index (+2.3 atomic, +4 aggregation, +8 structural)
                        console.log(a); // ------------------------------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                    }
                }
            
                            
                        
ifIfIf Complexity Index 7.2 Cyclomatic complexity 4
                            
                                
                
            
            
                ifIfIf(a: number) { // ------------------------- +0.2 Complexity index (+0.2 atomic)
                    if (a > 2) { // ---------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        if (a > 3) { // ------------------------ +1.9 Complexity index (+0.4 atomic, +0.5 nesting, +1 structural)
                            if (a > 4) { // -------------------- +2.4 Complexity index (+0.4 atomic, +1 nesting, +1 structural)
                                console.log('a > 4'); // ------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                            }
                        }
                    }
                }
            
                            
                        
ifIfIfElse Complexity Index 9.6 Cyclomatic complexity 4
                            
                                
                
            
            
                ifIfIfElse(a: number) { // ---------------------- +0.2 Complexity index (+0.2 atomic)
                    if (a > 2) { // ----------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        if (a > 3) { // ------------------------- +1.9 Complexity index (+0.4 atomic, +0.5 nesting, +1 structural)
                            if (a > 4) { // --------------------- +2.4 Complexity index (+0.4 atomic, +1 nesting, +1 structural)
                                console.log('a > 4'); // -------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                            } else { // ------------------------- +1.1 Complexity index (+0.1 atomic, +1 structural)
                                console.log('a <= 4'); // ------- +1.3 Complexity index (+0.3 atomic, +1 structural)
                            }
                        }
                    }
                }