Genese complexity report

<- weights.service.ts
Methods : 2
Complexity index : 14.8
Cyclomatic complexity : 5
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 weights.service.ts
merge Complexity Index 8.6 Cyclomatic complexity 3
                            
                                
            
            
                /**
                 * Merges the libraries-weights Json files
                 */
                static merge(): Weights { // ----------------------------------------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    try {
                        const index = require('./index.json'); // -------------------------------------------------------------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        const weights: Weights = {}; // ------------------------------------------------------------------------------------------------ +0.3 Complexity index (+0.3 atomic)
                        for (const library of Object.keys(index)) { // --------------------------------------------------------------------------------- +2.5 Complexity index (+0.5 atomic, +2 structural)
                            weights[library] = require(index[library]); // ----------------------------------------------------------------------------- +1.6 Complexity index (+0.6 atomic, +1 structural)
                        }
                        return weights; // ------------------------------------------------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    } catch (err) { // ----------------------------------------------------------------------------------------------------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        throw Error('Error merging libraries-weights : please verify paths in index.json and libraries-weights Json format'); // ------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                    }
                }
            
                            
                        
weightedMethods Complexity Index 6.2 Cyclomatic complexity 2
                            
                                
                
            
            
                /**
                 * Returns the names of the methods included in the libraries-weights Json files
                 */
                static weightedMethods(): string[] { // --------------------------------------------------- +0.3 Complexity index (+0.3 atomic)
                    let methods: string[] = []; // -------------------------------------------------------- +0.4 Complexity index (+0.4 atomic)
                    for (const library of Object.keys(WEIGHTS)) { // -------------------------------------- +2.5 Complexity index (+0.5 atomic, +2 structural)
                        methods = methods.concat(Object.keys(WEIGHTS[library])); // ----------------------- +2.8 Complexity index (+0.8 atomic, +2 structural)
                    }
                    return methods; // -------------------------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                }