33// The differences are subtle but need to be thought through and tested carefully.
44// Having separate files makes it obvious that there needs to be one for every new source code language.
55
6- MATCH (code_file :! Git &File )
6+ MATCH (code_file :! Git &File & ! Directory & ! Scan )
77WHERE (code_file .absoluteFileName IS NOT NULL OR code_file .fileName IS NOT NULL )
8- // Use only original code files, no resolved duplicates
9- AND NOT EXISTS { (code_file )- [: RESOLVES_TO ]- > (other_file : File &! Git ) }
108 WITH code_file
119 ,coalesce (code_file .absoluteFileName , code_file .fileName ) AS codeFileName
1210MATCH (git_file :Git &File )
11+ WHERE codeFileName ENDS WITH git_file .fileName
12+ OR codeFileName ENDS WITH git_file .relativePath
1313// Use repository if available to overcome ambiguity in multi source analysis
1414OPTIONAL MATCH (git_repository :Git &Repository )- [ : HAS_FILE ] -> (git_file )
1515 WITH *
@@ -19,8 +19,10 @@ OPTIONAL MATCH (git_repository:Git&Repository)-[:HAS_FILE]->(git_file)
1919 ,coalesce (git_repository .name + '/' , '' ) + git_file .relativePath
2020 ) AS gitFileName
2121WHERE codeFileName ENDS WITH gitFileName
22- MERGE (git_file )- [ : RESOLVES_TO ] -> (code_file )
23- SET git_file .resolved = true
22+ CALL { WITH git_file , code_file
23+ MERGE (git_file )- [: RESOLVES_TO ]- > (code_file )
24+ ON CREATE SET git_file .resolved = true
25+ } IN TRANSACTIONS
2426RETURN count (DISTINCT codeFileName ) AS numberOfCodeFiles
2527 ,collect (DISTINCT codeFileName + ' <-> ' + gitFileName + '\n ' )[0 ..4 ] AS examples
2628// RETURN codeFileName, gitFileName
0 commit comments