Genese complexity report

<- barchart.service.ts
Methods : 1
Complexity index : 5.4
Cyclomatic complexity : 3
Cognitive complexity
100 % Correct 1/1
0 % Warning 0/1 (threshold : 10)
0 % Error 0/1 (threshold : 20)
Cyclomatic complexity
100 % Correct 1/1
0 % Warning 0/1 (threshold : 5)
0 % Error 0/1 (threshold : 10)
Methods of barchart.service.ts
concat Complexity Index 5.4 Cyclomatic complexity 3
                            
                                
            
            
                /**
                 * Merge two BarCharts
                 * @param chart1
                 * @param chart2
                 */
                static concat(chart1: Barchart, chart2: Barchart): Barchart { // ------- +0.6 Complexity index (+0.6 atomic)
                    if (!chart2) { // -------------------------------------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
                        return chart1; // ---------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                    }
                    for (const bar of chart2.data) { // -------------------------------- +1.4 Complexity index (+0.4 atomic, +1 structural)
                        chart1 = chart1.addResult(bar.x, bar.y); // -------------------- +1.8 Complexity index (+0.8 atomic, +1 structural)
                    }
                    return chart1; // -------------------------------------------------- +0.2 Complexity index (+0.2 atomic)
                }