Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Last active February 20, 2022 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vladbatushkov/1ae3522a6efc06c2950913f0833d887b to your computer and use it in GitHub Desktop.
Save vladbatushkov/1ae3522a6efc06c2950913f0833d887b to your computer and use it in GitHub Desktop.
Detect n-deep dependencies from the outside
UNWIND ['module1.*', 'module2.*', 'module3.*'] as module
CALL {
WITH module
MATCH (s:File)-[:DEPENDS_ON*]->(d:File)
WHERE s.name =~ module
AND NOT d.name =~ module
AND NOT d.name =~ 'common.*'
RETURN DISTINCT s.name as subject,
collect(DISTINCT d.name) as dependencies
}
RETURN subject, dependencies
ORDER BY subject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment