Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kontext-e/375b665033e2680ab8a7f27861df716a to your computer and use it in GitHub Desktop.
Save kontext-e/375b665033e2680ab8a7f27861df716a to your computer and use it in GitHub Desktop.
match (c:Git:Change)-[:MODIFIES]->(f:Git:File)
where f.relativePath=~'.*.java'
with replace(replace(f.relativePath,'/','.'), '.java','') as gitfqn, count(c) as cnt
order by cnt desc
limit 100
match (cl:Jacoco:Class)--(m:Jacoco:Method)--(c:Jacoco:Counter {type: 'COMPLEXITY'})
WHERE gitfqn=~('.*'+cl.fqn) AND c.missed + c.covered > 5
AND NOT(m.signature = 'boolean equals(java.lang.Object)')
AND NOT(m.signature = 'int hashCode()')
AND NOT(cl.fqn =~ 'de.kontext_e.tim.jsf_ui.*')
WITH cnt, m AS method, cl.fqn AS fqn, m.signature AS signature, c.missed + c.covered AS complexity
MATCH (m)--(branches:Jacoco:Counter {type: 'BRANCH'})
WHERE m = method AND branches.covered * 100 / (branches.covered + branches.missed) < 95
RETURN cnt, fqn, signature, complexity, branches.covered * 100 / (branches.covered + branches.missed) AS coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment