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

course/js/index.js   A

Complexity

Total Complexity 4
Complexity/F 1.33

Size

Lines of Code 10
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
nc 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
wmc 4
mnd 1
bc 3
fnc 3
bpm 1
cpm 1.3333
noi 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A graphs.loadGraph 0 8 2
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