Passed
Push — master ( c84e5c...0e0008 )
by philippe
04:14
created

doc/phpmetrics/js/functions.js   A

Complexity

Total Complexity 5
Complexity/F 1.67

Size

Lines of Code 20
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 11
dl 0
loc 20
rs 10
c 1
b 0
f 0
cc 0
nc 1
mnd 1
bc 4
fnc 3
bpm 1.3333
cpm 1.6666
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A functions.js ➔ equalsHeightOf 0 5 1
1
function loadJSON(filename, callback) {
2
3
    var xobj = new XMLHttpRequest();
4
    xobj.overrideMimeType("application/json");
5
    xobj.open('GET', filename, true);
6
    xobj.onreadystatechange = function () {
7
        if (xobj.readyState == 4 && xobj.status == "200") {
8
            // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
9
            callback(xobj.responseText);
10
        }
11
    };
12
    xobj.send(null);
13
}
14
15
16
function equalsHeightOf(node1, node2) {
17
    var w1 = node1.style.height;
18
    node2.style.height = w1 + 'px';
19
20
}