Skip to content

Commit d61187c

Browse files
committed
Use "no namespace" as placeholder for empty namespaces
1 parent a1fae99 commit d61187c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cypher/External_Dependencies/External_namespace_usage_overall_for_Typescript.cypher

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ UNWIND internalElementList AS internalElement
1212
MATCH (externalModule:ExternalModule)-[:EXPORTS]->(externalDeclaration)
1313
WITH allInternalElements
1414
,allModules
15-
,externalModule.namespace AS externalNamespaceName
16-
,count(DISTINCT internalModule.globalFqn) AS numberOfExternalCallerModules
17-
,count(DISTINCT internalElement.globalFqn) AS numberOfExternalCallerElements
18-
,count(externalDependency) AS numberOfExternalDeclarationCalls
19-
,sum(externalDependency.cardinality) AS numberOfExternalDeclarationCallsWeighted
15+
,coalesce(nullif(externalModule.namespace, ''), 'no namespace') AS externalNamespaceName
16+
,count(DISTINCT internalModule.globalFqn) AS numberOfExternalCallerModules
17+
,count(DISTINCT internalElement.globalFqn) AS numberOfExternalCallerElements
18+
,count(externalDependency) AS numberOfExternalDeclarationCalls
19+
,sum(externalDependency.cardinality) AS numberOfExternalDeclarationCallsWeighted
2020
,collect('<' + internalElement.name
2121
+ '> of module <'
2222
+ internalModule.name
2323
+ '> imports <'
2424
+ externalDeclaration.name
2525
+ '> from external namespace <'
26-
+ externalModule.namespace + '>')[0..4] AS exampleStories
26+
+ externalModule.namespace + '>')[0..4] AS exampleStories
2727
RETURN externalNamespaceName
2828
,numberOfExternalCallerModules
2929
,numberOfExternalCallerElements

cypher/External_Dependencies/External_namespace_usage_per_internal_module_sorted_for_Typescript.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ UNWIND internalElementList AS internalElement
2222
,internalModuleName
2323
,internalElement.globalFqn AS fullInternalElementName
2424
,internalElement.name AS internalElementName
25-
,externalModule.namespace AS externalNamespaceName
25+
,coalesce(nullif(externalModule.namespace, ''), 'no namespace') AS externalNamespaceName
2626
,externalDeclaration.name AS externalDeclarationName
2727
WITH numberOfAllElementsInInternalModule
2828
,numberOfAllExternalDeclarationsUsedInInternalModule

cypher/External_Dependencies/External_namespace_usage_spread_for_Typescript.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ UNWIND internalElementList AS internalElement
1515
MATCH (externalModule:TS:ExternalModule)-[:EXPORTS]->(externalDeclaration)
1616
WITH internalModulesCountOverall
1717
,internalElementsCountOverall
18-
,externalModule.namespace AS externalModuleNamespace
18+
,coalesce(nullif(externalModule.namespace, ''), 'no namespace') AS externalModuleNamespace
1919
,coalesce(nullIf(internalModule.namespace, '') + '/' + internalModule.name, internalModule.name) AS internalModuleName
2020

2121
// Gathering counts for every internal element and the external module it uses

0 commit comments

Comments
 (0)