GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 75229a...a07b43 )
by Sebastian
02:01
created

javascript/domReady.js   A

Complexity

Total Complexity 7
Complexity/F 3.5

Size

Lines of Code 26
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 0
eloc 18
c 3
b 0
f 0
nc 1
dl 0
loc 26
rs 10
wmc 7
mnd 2
bc 6
fnc 2
bpm 3
cpm 3.5
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A domReady.js ➔ domReady 0 24 5
1
'use strict';
2
3
function domReady(fn) {
4
    var fns = [],
5
        listener,
6
        doc = typeof document === 'object' && document,
7
        hack = doc && doc.documentElement.doScroll,
8
        domContentLoaded = 'DOMContentLoaded',
9
        loaded = doc && (hack ? /^loaded|^c/ : /^loaded|^i|^c/).test(doc.readyState);
10
11
    if (!loaded && doc) {
12
        doc.addEventListener(domContentLoaded, listener = function () {
13
            doc.removeEventListener(domContentLoaded, listener);
14
            loaded = 1;
15
            while (listener = fns.shift()) {
16
                listener();
17
            }
18
        })
19
    }
20
21
    if (loaded) {
22
        setTimeout(fn, 0);
23
    } else {
24
        fns.push(fn);
25
    }
26
}
27