Completed
Push — master ( 68e12f...ab20ed )
by Seth
02:02
created

gradingAnalytics.loadChart   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
/*jslint browser */
2
/*global $,fetch,Chart */
3
var gradingAnalytics = {
4
  loadChart: 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 Seth Battis
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