src/random.js   A
last analyzed

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 11
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
mnd 0
bc 0
fnc 2
dl 0
loc 11
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

2 Functions

Rating   Name   Duplication   Size   Complexity  
A Random.uniform 0 3 1
A Random.int 0 3 1
1
export class Random {
2
    uniform(max, min) {
3
        return Math.random() * (max - min) + min;
4
    }
5
6
    int(max, min) {
7
        return Math.floor(this.uniform(max, min));
8
    }
9
}
10
11
export const random = new Random();
12