public/js/functions.js   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 1.67

Size

Lines of Code 22
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 22
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 6 1
1
function loadJSON(filename, callback)
2
{
3
4
    var xobj = new XMLHttpRequest();
5
    xobj.overrideMimeType("application/json");
6
    xobj.open('GET', filename, true);
7
    xobj.onreadystatechange = function () {
8
        if (xobj.readyState == 4 && xobj.status == "200") {
9
            // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
10
            callback(xobj.responseText);
11
        }
12
    };
13
    xobj.send(null);
14
}
15
16
17
function equalsHeightOf(node1, node2)
18
{
19
    var w1 = node1.style.height;
20
    node2.style.height = w1 + 'px';
21
22
}