Skip to content

Instantly share code, notes, and snippets.

@kontext-e
kontext-e / docker-compose.yaml
Created April 11, 2018 14:24
docker-compose file for drone.io with Gogs
version: '2'
services:
drone-server:
image: drone/drone:0.8
ports:
- 8000:8000
- 9000
volumes:
@kontext-e
kontext-e / uncle_bob_scribe_oath.md
Created November 13, 2017 08:11 — forked from ebramanti/uncle_bob_scribe_oath.md
Uncle Bob Scribe's Oath

Uncle Bob - Scribe's Oath

  1. I will not produce harmful code.
    • I will not intentionally write code with bugs.
    • This means: Do your best.
  2. I will not produce code that's not my best.
  3. I will provide with each release a quick, testable & repeatable proof that the code works.
  4. I will not avoid release that will impede progress.
    • Short term rapid releases
  5. I will fearlessly and relentlessly improve the quality of code.
  • I will never make the code worse.
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.*')
match (c:Git:Change)-[:MODIFIES]->(f:Git:File)
with f.relativePaht as path
where path=~'.*.java'
return count(c) as cnt, path
order by cnt desc;
MATCH
(otherFile:GitCommitFile)--(c:GitCommit)--(cf:GitCommitFile)
RETURN
cf.relativePath, otherFile.relativePath, count(otherFile.relativePath) as coupled
ORDER
by coupled desc;
MATCH
(g:GitFile)--(cf:GitCommitFile)--(c:GitCommit)--(otherFile:GitCommitFile)
RETURN
g.relativePath, count(c.sha) as soc
ORDER BY
soc desc;
@kontext-e
kontext-e / codeascrimescene_hotspot.cypher
Last active November 28, 2015 20:25
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
@kontext-e
kontext-e / ParameterNameGenerator
Last active December 5, 2019 12:33
Plugin for IntelliJ LivePlugin; adds a new intention for generating call parameters based on the parameters of the called method
// Usage:
// Install LivePlugin http://plugins.jetbrains.com/plugin/7282
// Install this plugin into LivePlugin and run it
// In source code, create a method or constructor call and place the cursor into the empty braces
// Open the intentions drop down menu and select the "Create variables for method call parameters"
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.Document
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiCallExpression