Class: MetricFu::CaneGrapher
- Inherits:
-
Grapher
- Object
- Grapher
- MetricFu::CaneGrapher
show all
- Defined in:
- lib/metric_fu/metrics/cane/grapher.rb
Instance Attribute Summary collapse
Attributes inherited from Grapher
#output_directory
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Grapher
#date, get_grapher, #graph!, graphers
Constructor Details
Returns a new instance of CaneGrapher.
10
11
12
13
14
|
# File 'lib/metric_fu/metrics/cane/grapher.rb', line 10
def initialize
super
@cane_violations = []
@labels = {}
end
|
Instance Attribute Details
#cane_violations ⇒ Object
Returns the value of attribute cane_violations.
4
5
6
|
# File 'lib/metric_fu/metrics/cane/grapher.rb', line 4
def cane_violations
@cane_violations
end
|
#labels ⇒ Object
Returns the value of attribute labels.
4
5
6
|
# File 'lib/metric_fu/metrics/cane/grapher.rb', line 4
def labels
@labels
end
|
Class Method Details
.metric ⇒ Object
6
7
8
|
# File 'lib/metric_fu/metrics/cane/grapher.rb', line 6
def self.metric
:cane
end
|
Instance Method Details
#data ⇒ Object
27
28
29
30
31
|
# File 'lib/metric_fu/metrics/cane/grapher.rb', line 27
def data
[
["cane", @cane_violations.join(",")]
]
end
|
#get_metrics(metrics, date) ⇒ Object
16
17
18
19
20
21
|
# File 'lib/metric_fu/metrics/cane/grapher.rb', line 16
def get_metrics(metrics, date)
if metrics && metrics[:cane]
@cane_violations.push(metrics[:cane][:total_violations].to_i)
@labels.update(@labels.size => date)
end
end
|
#output_filename ⇒ Object
33
34
35
|
# File 'lib/metric_fu/metrics/cane/grapher.rb', line 33
def output_filename
"cane.js"
end
|
#title ⇒ Object
23
24
25
|
# File 'lib/metric_fu/metrics/cane/grapher.rb', line 23
def title
"Cane: code quality threshold violations"
end
|