Completed
Push — master ( 7682df...b1b8c7 )
by Timo
23:42 queued 14:36
created

Resources/Public/JavaScript/SearchStatistics.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 65
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A SearchStatistics.js ➔ require 0 62 1
1
2
require([
3
  'jquery',
4
  '../typo3conf/ext/solr/Resources/Public/JavaScript/Chart.js'
5
], function ($, Chart) {
6
7
  var ctx = $('#queriesOverTime');
8
  var queryChart = new Chart(ctx, {
0 ignored issues
show
Unused Code introduced by
The variable queryChart seems to be never used. Consider removing it.
Loading history...
9
    type: 'line',
10
    data: {
11
      labels: queryLabels,
0 ignored issues
show
Bug introduced by
The variable queryLabels seems to be never declared. If this is a global, consider adding a /** global: queryLabels */ 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...
12
      datasets: [
13
        {
14
          data: queryData,
0 ignored issues
show
Bug introduced by
The variable queryData seems to be never declared. If this is a global, consider adding a /** global: queryData */ 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...
15
          label: "# of Queries",
16
17
          lineTension: 0.1,
18
          fill: false,
19
          backgroundColor: 'rgba(206, 43, 23, 0.4)',
20
21
          borderColor: 'rgba(206, 43, 23, 1)',
22
          borderCapStyle: 'round',
23
          borderJoinStyle: 'round',
24
25
          pointRadius: 2,
26
          pointHitRadius: 10,
27
          pointBorderColor: 'rgba(206, 43, 23, 1)',
28
          pointBackgroundColor: '#fff',
29
          pointBorderWidth: 1,
30
31
          pointHoverRadius: 7,
32
          pointHoverBackgroundColor: 'rgba(206, 43, 23, 1)',
33
          pointHoverBorderColor: '#fff',
34
          pointHoverBorderWidth: 3
35
        }
36
      ]
37
    },
38
    options: {
39
      animation: {
40
        duration: 0
41
      },
42
      legend: {
43
        display: false
44
      },
45
      tooltips: {
46
        cornerRadius: 3
47
      },
48
      scales: {
49
        yAxes: [{
50
          ticks: {
51
            beginAtZero:true
52
          },
53
          gridLines: {
54
            drawBorder: false
55
          }
56
        }],
57
        xAxes: [{
58
          gridLines: {
59
            display: false
60
          }
61
        }]
62
      }
63
    }
64
  });
65
66
});
67