Skip to content

Instantly share code, notes, and snippets.

@kontext-e
Last active November 28, 2015 20:25
Show Gist options
  • Save kontext-e/a5da831e6efe5741cc43 to your computer and use it in GitHub Desktop.
Save kontext-e/a5da831e6efe5741cc43 to your computer and use it in GitHub Desktop.
From Book "Your Code As a Crime Scene" Cypher query for hotspots
MATCH
(l:Linecount), (g:GitFile)
WHERE
g.relativePath =~ ('.*'+l.name)
WITH
distinct g, l.linecount as linecount
MATCH
(g)--(cf:GitCommitFile)
RETURN
g.relativePath, count(cf) as revisions, linecount
ORDER BY
revisions desc, linecount desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment