Completed
Push — master ( 505b4c...62d9c0 )
by Seth
05:17 queued 03:12
created

graphs.loadGraph   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 4
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A 0 3 1
1
/*jslint browser */
2
/*global $,fetch,Chart */
3
var graphs = {
4
    loadGraph: function (domId, chartUrl, course_id, department_id = false) {
5
        fetch("chart/" + chartUrl + "?course_id=" + course_id + (department_id !== false ? "&department_id=" + department_id : ""))
6
            .then(function (response) {
7
                return response.json();
8
            }).then(function (data) {
9
                new Chart($(domId), data);
0 ignored issues
show
Unused Code Best Practice introduced by
The object created with new Chart($(domId), data) is not used but discarded. Consider invoking another function instead of a constructor if you are doing this purely for side effects.
Loading history...
10
            });
11
    }
12
};
13