Passed
Push — master ( 589cc4...8de2f9 )
by Corey
03:11
created

site/web/js/checkin/charts/pie.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 21
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
dl 0
loc 21
rs 10
c 1
b 0
f 0
cc 0
nc 1
mnd 0
bc 2
fnc 2
bpm 1
cpm 1
noi 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A $(document).ready 0 19 1
1
(function($, Chart) {
2
  $(document).ready(function() {
3
    Chart.defaults.global.responsive = true;
4
    Chart.defaults.global.scaleBeginAtZero = true;
5
    Chart.defaults.global.maintainAspectRatio = false;
6
7
    var pie_ctx = document.getElementById('category-pie-chart').getContext('2d');
8
9
    var pie_data = JSON.parse(document.getElementById('pie_data').innerHTML);
10
11
    var pieChart = new Chart(pie_ctx, {
0 ignored issues
show
Unused Code introduced by
The variable pieChart seems to be never used. Consider removing it.
Loading history...
12
      type: 'pie',
13
      data: pie_data,
14
      options: {
15
        legend: {
16
          display: false
17
        }
18
      }
19
    });
20
  });
21
})(jQuery, Chart)
0 ignored issues
show
Bug introduced by
The variable Chart seems to be never declared. If this is a global, consider adding a /** global: Chart */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
22