Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
app/helpers/iterations_helper.rb | 40 | 26 | 92.50%
|
88.46%
|
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
1 module IterationsHelper |
2 |
3 # TODO: Untested! |
4 # |
5 def burndown_chart(iteration, data) |
6 |
7 total_points = 0 |
8 points_data = [] |
9 |
10 unless data.nil? or data.empty? |
11 total_points = data[0].total_points.to_i |
12 points_data = data.collect{|d| d.points.to_i} |
13 end |
14 |
15 work_days = [] |
16 (iteration.start_date.to_date..iteration.end_date.to_date).to_a.each do |date| |
17 work_days.push date.strftime('%d/%m') unless date.wday == 0 or date.wday == 6 |
18 end |
19 |
20 # Keep adding the last value to flatline the chart |
21 while work_days.length > data.length |
22 data.push data[data.length - 1] |
23 end |
24 |
25 # Make some gradations for the y axis labels |
26 y_scale = [0] |
27 [4, 2, 1.5, 1.25, 1].each do |n| |
28 unit = (total_points / n).floor |
29 y_scale.push unit if unit > 0 |
30 end |
31 |
32 image_tag Gchart.line(:size => '500x300', |
33 :title => "#{iteration.name} burndown", |
34 :data => points_data, :axis_with_labels => 'x,y', |
35 :axis_labels => [work_days, y_scale]) |
36 |
37 end |
38 |
39 end |
40 |
Generated on Thu Jan 07 15:27:03 +0000 2010 with rcov 0.9.6