Class: MetricFu::FlogGrapher
- Inherits:
-
Grapher
- Object
- Grapher
- MetricFu::FlogGrapher
show all
- Defined in:
- lib/metric_fu/metrics/flog/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
10
11
12
13
14
15
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 10
def initialize
super
@flog_average = []
@labels = {}
@top_five_percent_average = []
end
|
Instance Attribute Details
#flog_average ⇒ Object
Returns the value of attribute flog_average.
4
5
6
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 4
def flog_average
@flog_average
end
|
#labels ⇒ Object
Returns the value of attribute labels.
4
5
6
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 4
def labels
@labels
end
|
#top_five_percent_average ⇒ Object
Returns the value of attribute top_five_percent_average.
4
5
6
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 4
def top_five_percent_average
@top_five_percent_average
end
|
Class Method Details
.metric ⇒ Object
6
7
8
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 6
def self.metric
:flog
end
|
Instance Method Details
#data ⇒ Object
29
30
31
32
33
34
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 29
def data
[
["average", @flog_average.join(",")],
["top 5% average", @top_five_percent_average.join(",")]
]
end
|
#get_metrics(metrics, date) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 17
def get_metrics(metrics, date)
if metrics && metrics[:flog]
@top_five_percent_average.push(calc_top_five_percent_average(metrics))
@flog_average.push(metrics[:flog][:average])
@labels.update(@labels.size => date)
end
end
|
#output_filename ⇒ Object
36
37
38
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 36
def output_filename
"flog.js"
end
|
#title ⇒ Object
25
26
27
|
# File 'lib/metric_fu/metrics/flog/grapher.rb', line 25
def title
"Flog: code complexity"
end
|