Genese complexity report

<- cpx-factors.model.ts
Methods : 2
Complexity index : 7.1
Cyclomatic complexity : 3
Cognitive complexity
100 % Correct 2/2
0 % Warning 0/2 (threshold : 10)
0 % Error 0/2 (threshold : 20)
Cyclomatic complexity
100 % Correct 2/2
0 % Warning 0/2 (threshold : 5)
0 % Error 0/2 (threshold : 10)
Methods of cpx-factors.model.ts
totalByFactorCategory Complexity Index 5.1 Cyclomatic complexity 2
                            
                                
                
            
            
            
                // ---------------------------------------------------------------------------------
                //                                  Other methods
                // ---------------------------------------------------------------------------------
            
            
                /**
                 * Returns the total Complexity Index for a given Category of Factors
                 * @param factorCategory
                 */
                private totalByFactorCategory(factorCategory: FactorCategory): number { // -------------------- +0.3 Complexity index (+0.3 atomic)
                    let total = 0; // ------------------------------------------------------------------------- +0.3 Complexity index (+0.3 atomic)
                    for (const keyFeature of Object.keys(this[factorCategory])) { // -------------------------- +2.6 Complexity index (+0.6 atomic, +2 structural)
                        total += this[factorCategory][keyFeature] ?? 0; // ------------------------------------ +1.7 Complexity index (+0.7 atomic, +1 aggregation)
                    }
                    return total; // -------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                }
            
                            
                        
add Complexity Index 2 Cyclomatic complexity 1
                            
                                
                
            
            
                /**
                 * Adds a CpxFactors object to another one
                 * @param cpxFactors
                 */
                add(cpxFactors: CpxFactors): CpxFactors { // ------------------------------ +0.4 Complexity index (+0.4 atomic)
                    return addObjects<CpxFactors>(this, cpxFactors, CpxFactors); // ------- +1.6 Complexity index (+0.6 atomic, +1 structural)
                }