Class: Ossert::Stats::AgilityTotal
- Inherits:
-
Base
- Object
- Base
- Ossert::Stats::AgilityTotal
show all
- Defined in:
- lib/ossert/stats/agility_total.rb
Instance Method Summary
collapse
Methods inherited from Base
#<<, absolute_attributes, attributes, attributes_names, config, create_attributes_accessors, define_counts, define_ints, define_percent, #initialize, #median, #metric_values, metrics, #metrics_to_hash, #to_hash, #to_json, uniq_attributes
Instance Method Details
#commits_count_since_last_release_count ⇒ Object
28
29
30
|
# File 'lib/ossert/stats/agility_total.rb', line 28
def commits_count_since_last_release_count
commits_count_since_last_release.is_a?(Array) ? 0 : commits_count_since_last_release
end
|
#issues_active ⇒ Object
32
33
34
|
# File 'lib/ossert/stats/agility_total.rb', line 32
def issues_active
issues_open - issues_closed
end
|
#issues_all ⇒ Object
36
37
38
|
# File 'lib/ossert/stats/agility_total.rb', line 36
def issues_all
issues_open + issues_closed
end
|
#last_changed ⇒ Object
48
49
50
|
# File 'lib/ossert/stats/agility_total.rb', line 48
def last_changed
[last_pr_date.presence, last_issue_date.presence].compact.max || 10.years.ago
end
|
#life_period ⇒ Object
52
53
54
55
56
57
58
59
60
|
# File 'lib/ossert/stats/agility_total.rb', line 52
def life_period
last_change = [last_pr_date.presence, last_issue_date.presence].compact.max
return 0 unless last_change
first_change = [first_pr_date, first_issue_date].compact.min
return 0 unless first_change
(last_change - first_change).to_i
end
|
#life_period_months ⇒ Object
62
63
64
|
# File 'lib/ossert/stats/agility_total.rb', line 62
def life_period_months
life_period / 1.month
end
|
#pr_active ⇒ Object
40
41
42
|
# File 'lib/ossert/stats/agility_total.rb', line 40
def pr_active
pr_open - pr_closed
end
|
#pr_all ⇒ Object
44
45
46
|
# File 'lib/ossert/stats/agility_total.rb', line 44
def pr_all
pr_open + pr_closed
end
|
#releases_count ⇒ Object
66
67
68
|
# File 'lib/ossert/stats/agility_total.rb', line 66
def releases_count
[releases_total_rg.count, releases_total_gh.count].max
end
|