Completed
Pull Request — master (#44)
by Alejandro
02:55 queued 36s
created

src/utils/utils.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 6
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
eloc 4
c 1
b 0
f 0
nc 1
dl 0
loc 6
ccs 2
cts 4
cp 0.5
crap 0
rs 10
wmc 2
mnd 0
bc 1
fnc 2
bpm 0.5
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A utils.js ➔ ??? 0 4 1
1 2
const DEFAULT_TIMEOUT_DELAY = 2000;
2
3 2
export const stateFlagTimeout = (setState, flagName, initialValue = true, delay = DEFAULT_TIMEOUT_DELAY) => {
4
  setState({ [flagName]: initialValue });
5
  setTimeout(() => setState({ [flagName]: !initialValue }), delay);
6
};
7