Skip to content

Instantly share code, notes, and snippets.

@ikwattro
Created August 13, 2014 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikwattro/96f42559346d99518169 to your computer and use it in GitHub Desktop.
Save ikwattro/96f42559346d99518169 to your computer and use it in GitHub Desktop.
Gh4j Queries

Which User did the most forks

MATCH (n:User)-[:DO]-(event)-[:FORK]-(fork:Fork)
WITH n, collect(fork) as forks
ORDER BY forks DESC
RETURN n.name, count(forks) as forkees
LIMIT 1

Which User opened the most PR'S

MATCH (n:User)-[:DO]-(event)-[:PR_OPEN]-(pr:PullRequest)
WITH n, collect(pr) as prs
ORDER BY prs DESC
RETURN n.name, count(prs) as pullRequests
LIMIT 1

Which Repository received the most PR's

MATCH (event:PullRequestEvent)-[:PR_OPEN]-(pr:PullRequest)-[:PR_ON]-(repo:Repository)
WITH repo, collect(event) as openings
ORDER BY openings DESC
RETURN repo.name, count(openings) as open_prs

Which User did the most PR's finishing as MERGED

Which User did the most PR's finishing as MERGED but not on his own repositories

Which Repository has the most MERGE PR's coming from Users not owning the Repository

What is the average comments amount for a PR before the MERGE

What is the percentage of Forks resulting in MERGED PR's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment