Passed
Push — trunk ( 2f4e4b...9236fc )
by Christian
13:18 queued 12s
created

src/Administration/Resources/app/administration/test/_helper_/flushPromises.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
eloc 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
wmc 3
mnd 1
bc 1
fnc 2
bpm 0.5
cpm 1.5
noi 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A flushPromises.js ➔ flushPromises 0 5 3
1
const scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;
0 ignored issues
show
Bug introduced by
The variable setImmediate seems to be never declared. If this is a global, consider adding a /** global: setImmediate */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable setTimeout seems to be never declared. If this is a global, consider adding a /** global: setTimeout */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
2
3
export default function flushPromises() {
4
    return new Promise((resolve) => {
5
        scheduler(resolve);
6
    });
7
}
8