src/Fatum.js   A
last analyzed

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 16
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
mnd 1
bc 1
fnc 2
dl 0
loc 16
rs 10
bpm 0.5
cpm 1.5
noi 0
c 0
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A Fatum.addGenerators 0 8 2
A Fatum.addGenerator 0 5 1
1
export default class Fatum {
2
    addGenerators(generators) {
3
        for (const generatorName of Object.keys(generators)) {
4
            this.addGenerator(
5
                generatorName,
6
                generators[generatorName]
7
            );
8
        }
9
    }
10
11
    addGenerator(generatorName, Generator) {
12
        const generator = new Generator(this);
13
14
        this[generatorName] = generator.generate.bind(generator);
15
    }
16
}
17