lib/cobench/metrics/commits.rb in cobench-0.0.17 vs lib/cobench/metrics/commits.rb in cobench-0.0.18
- old
+ new
@@ -32,19 +32,20 @@
@opts = opts
end
def take(loog)
from = (Time.now - (60 * 60 * 24 * @opts[:days])).strftime('%Y-%m-%d')
- q = "author:#{@user} author-date:>#{from}"
+ q = "author:#{@user} author-date:>#{from} is:public merge:false"
json = @api.search_commits(q)
loog.debug("Found #{json.total_count} commits")
hoc = 0
total = json.items.count do |c|
sha = c.sha
repo = c.repository.full_name
next unless Cobench::Match.new(@opts, loog).matches?(repo)
loog.debug("Including #{sha} in #{repo}")
json = @api.commit(repo, sha)
+ next unless json
hocs = json.stats.total
loog.debug("Found #{hocs} HoC in #{sha}")
hoc += hocs
end
[