bin/pull_req_data_extraction.rb
# Median number of commits to files touched by the pull request relative to
# all (including those coming from PRs) project commits during the last three months
Median number of commits to files touched by the pull request relative to
all (including those coming from PRs) project commits during the last three months
Median number of commits to files touched by the pull request relative to all ( including those coming from PRs ) project commits during the last three months
def hotness(pr, months_back)
    commits_per_file = commits_on_pr_files(pr, months_back).map{|x| x[1].size}.sort
    med = commits_per_file[commits_per_file.size/2]
    med = 0 if med.nil?
    all_commits = commits_last_x_months(pr, false, months_back)
    all_commits = 1 if all_commits == 0
    med / all_commits.to_f
  end
def hotness ( pr , months_back ) commits_per_file = commits_on_pr_files ( pr , months_back ) . map { | x | x [ 1 ] . size } . sort med = commits_per_file [ commits_per_file . size / 2 ] med = 0 if med . nil? all_commits = commits_last_x_months ( pr , false , months_back ) all_commits = 1 if all_commits == 0 med / all_commits . to_f end
Median number of commits to files touched by the pull request relative to
all (including those coming from PRs) project commits during the last three months
Median number of commits to files touched by the pull request relative to all ( including those coming from PRs ) project commits during the last three months
pr
months_back