Skip to content

Commit a760f19

Browse files
committed
Add reports for frequently changed files
1 parent 504a709 commit a760f19

File tree

6 files changed

+343
-18
lines changed

6 files changed

+343
-18
lines changed

cypher/GitLog/List_pairwise_changed_files.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RETURN firstFileName
1414
,firstFile.extension AS firstFileExtension
1515
,secondFile.extension AS secondFileExtension
1616
,firstFile.extension + '↔' + secondFile.extension AS fileExtensionPair
17-
,toInteger(pairwiseChange.updateCommitCount) AS updateCommitCount
17+
,pairwiseChange.updateCommitCount AS updateCommitCount
1818
,pairwiseChange.updateCommitMinConfidence AS updateCommitMinConfidence
1919
,pairwiseChange.updateCommitSupport AS updateCommitSupport
2020
,pairwiseChange.updateCommitLift AS updateCommitLift
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// List top pairs of files that were changed together by their commit count. Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher to run first.
2+
3+
MATCH (firstFile:Git:File)-[pairwiseChange:CHANGED_TOGETHER_WITH]-(secondFile:Git:File)
4+
WHERE elementId(firstFile) < elementId(secondFile)
5+
WITH *
6+
,coalesce(firstFile.relativePath, firstFile.fileName) AS firstFileName
7+
,coalesce(secondFile.relativePath, secondFile.fileName) AS secondFileName
8+
RETURN firstFile.name AS firstFileNameShort
9+
,secondFile.name AS secondFileNameShort
10+
,firstFileName
11+
,secondFileName
12+
,pairwiseChange.updateCommitCount AS updateCommitCount
13+
,pairwiseChange.updateCommitMinConfidence AS updateCommitMinConfidence
14+
,pairwiseChange.updateCommitSupport AS updateCommitSupport
15+
,pairwiseChange.updateCommitLift AS updateCommitLift
16+
,pairwiseChange.updateCommitJaccardSimilarity AS updateCommitJaccardSimilarity
17+
ORDER BY updateCommitCount DESC
18+
LIMIT 50
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// List top pairs of files that were changed together by their commit jaccard similarity (0: never change together, 1: always change together). Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher to run first.
2+
3+
MATCH (firstFile:Git:File)-[pairwiseChange:CHANGED_TOGETHER_WITH]-(secondFile:Git:File)
4+
WHERE elementId(firstFile) < elementId(secondFile)
5+
WITH *
6+
,coalesce(firstFile.relativePath, firstFile.fileName) AS firstFileName
7+
,coalesce(secondFile.relativePath, secondFile.fileName) AS secondFileName
8+
RETURN firstFile.name AS firstFileNameShort
9+
,secondFile.name AS secondFileNameShort
10+
,firstFileName
11+
,secondFileName
12+
,pairwiseChange.updateCommitJaccardSimilarity AS updateCommitJaccardSimilarity
13+
,pairwiseChange.updateCommitCount AS updateCommitCount
14+
,pairwiseChange.updateCommitLift AS updateCommitLift
15+
,pairwiseChange.updateCommitMinConfidence AS updateCommitMinConfidence
16+
,pairwiseChange.updateCommitSupport AS updateCommitSupport
17+
ORDER BY updateCommitJaccardSimilarity DESC
18+
LIMIT 50
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// List top pairs of files that were changed together by their commit lift (>1: changes more often than by random chance). Requires Add_CHANGED_TOGETHER_WITH_relationships_to_git_files.cypher to run first.
2+
3+
MATCH (firstFile:Git:File)-[pairwiseChange:CHANGED_TOGETHER_WITH]-(secondFile:Git:File)
4+
WHERE elementId(firstFile) < elementId(secondFile)
5+
WITH *
6+
,coalesce(firstFile.relativePath, firstFile.fileName) AS firstFileName
7+
,coalesce(secondFile.relativePath, secondFile.fileName) AS secondFileName
8+
RETURN firstFile.name AS firstFileNameShort
9+
,secondFile.name AS secondFileNameShort
10+
,firstFileName
11+
,secondFileName
12+
,pairwiseChange.updateCommitLift AS updateCommitLift
13+
,pairwiseChange.updateCommitCount AS updateCommitCount
14+
,pairwiseChange.updateCommitMinConfidence AS updateCommitMinConfidence
15+
,pairwiseChange.updateCommitSupport AS updateCommitSupport
16+
,pairwiseChange.updateCommitJaccardSimilarity AS updateCommitJaccardSimilarity
17+
ORDER BY updateCommitLift DESC
18+
LIMIT 50

0 commit comments

Comments
 (0)