bin/pull_req_data_extraction.rb
# Number of commit comments on commits composing the pull request
Number of commit comments on commits composing the pull request
Number of commit comments on commits composing the pull request
def num_commit_comments(pr, at_open = false)
    if at_open
      q = <<-QUERY
      select count(*) as commit_comment_count
      from pull_request_commits prc, commit_comments cc,
           pull_request_history prh
      where prc.commit_id = cc.commit_id
        and prh.action = 'opened'
        and cc.created_at <= prh.created_at
        and prh.pull_request_id = prc.pull_request_id
        and prc.pull_request_id = ?
      QUERY
    else
      q = <<-QUERY
      select count(*) as commit_comment_count
      from pull_request_commits prc, commit_comments cc
      where prc.commit_id = cc.commit_id
        and prc.pull_request_id = ?
      QUERY
    end
    db.fetch(q, pr[:id]).first[:commit_comment_count]
  end
def num_commit_comments ( pr , at_open = false ) if at_open q = <<-QUERY 
      select count(*) as commit_comment_count
      from pull_request_commits prc, commit_comments cc,
           pull_request_history prh
      where prc.commit_id = cc.commit_id
        and prh.action = 'opened'
        and cc.created_at <= prh.created_at
        and prh.pull_request_id = prc.pull_request_id
        and prc.pull_request_id = ?
       QUERY else q = <<-QUERY 
      select count(*) as commit_comment_count
      from pull_request_commits prc, commit_comments cc
      where prc.commit_id = cc.commit_id
        and prc.pull_request_id = ?
       QUERY end db . fetch ( q , pr [ :id ] ) . first [ :commit_comment_count ] end
Number of commit comments on commits composing the pull request
Number of commit comments on commits composing the pull request
pr
at_open