Passed
Pull Request — master (#30)
by Pieter Epeüs
01:35
created

src/modules/summ.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 7
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 4
mnd 1
bc 1
fnc 2
dl 0
loc 7
rs 10
bpm 0.5
cpm 1.5
noi 0
c 0
b 0
f 0
1
module.exports = function summ(originalArray) {
2
    if (!Array.isArray(originalArray) || originalArray.length < 1) {
3
        return null;
4
    }
5
6
    return originalArray.reduce((a, b) => a + b, 0);
7
};
8