-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSet_Outgoing_Java_Package_Method_Call_Dependencies.cypher
More file actions
27 lines (26 loc) · 1.29 KB
/
Set_Outgoing_Java_Package_Method_Call_Dependencies.cypher
File metadata and controls
27 lines (26 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//Set Outgoing Package Method Call Dependencies
MATCH (p:Java:Package)
OPTIONAL MATCH (p)-[:CONTAINS]->(t:Java:Type)-[:DECLARES]->(m:Method)-[:INVOKES]->(dm:Method)<-[:DECLARES]-(dt:Java:Type)<-[:CONTAINS]-(dp:Package)<-[:CONTAINS]-(da:Artifact)
OPTIONAL MATCH (dm)<-[:DECLARES]-(dti:Interface)
WHERE p <> dp
WITH p
,COUNT(dm) AS outgoingMethodCalls
,COUNT(DISTINCT dm) AS outgoingDistinctMethodCalls
,COUNT(DISTINCT dt) AS outgoingMethodCallTypes
,COUNT(DISTINCT dti) AS outgoingMethodCallInterfaces
,COUNT(DISTINCT dp) AS outgoingMethodCallPackages
,COUNT(DISTINCT da) AS outgoingMethodCallArtifacts
SET p.outgoingMethodCalls = outgoingMethodCalls
,p.outgoingDistinctMethodCalls = outgoingDistinctMethodCalls
,p.outgoingMethodCallTypes = outgoingMethodCallTypes
,p.outgoingMethodCallInterfaces = outgoingMethodCallInterfaces
,p.outgoingMethodCallPackages = outgoingMethodCallPackages
,p.outgoingMethodCallArtifacts = outgoingMethodCallArtifacts
RETURN p.fqn AS packageName
,outgoingMethodCalls
,outgoingDistinctMethodCalls
,outgoingMethodCallTypes
,outgoingMethodCallInterfaces
,outgoingMethodCallPackages
,outgoingMethodCallArtifacts
ORDER BY outgoingMethodCalls DESC, packageName ASC