Skip to content

Commit 4bfceb0

Browse files
committed
Add statistics about resolved external Typescript modules
1 parent 23b725a commit 4bfceb0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Statistics about how many ExternalModule nodes were found that match internal Module nodes
2+
3+
MATCH (module:TS:Module)<-[resolved:RESOLVES_TO]-(external:TS:ExternalModule)
4+
OPTIONAL MATCH (project:TS:Project)-[:CONTAINS]->(module)
5+
WITH project.name AS projectName
6+
,count(DISTINCT module) AS resolvedModuleCount
7+
,COUNT { (modules:Module) } AS totalModuleCount
8+
,COUNT { (externalModules:ExternalModule) } AS totalExternalModuleCount
9+
,collect(DISTINCT module.fileName + ' -> ' + external.globalFqn)[0..4] AS resolvedExamples
10+
RETURN projectName
11+
,resolvedModuleCount
12+
,totalModuleCount
13+
,round(100.0 / totalModuleCount
14+
* resolvedModuleCount, 2) AS resolvedModulePercentage
15+
,totalExternalModuleCount
16+
,round(100.0 / totalExternalModuleCount
17+
* resolvedModuleCount, 2) AS resolvedExternalModulePercentage
18+
,resolvedExamples

scripts/reports/ExternalDependenciesCsv.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,7 @@ execute_cypher "${EXTERNAL_DEPENDENCIES_CYPHER_DIR}/External_namespace_usage_per
7272
execute_cypher "${EXTERNAL_DEPENDENCIES_CYPHER_DIR}/External_module_usage_per_internal_module_aggregated_for_Typescript.cypher" > "${FULL_REPORT_DIRECTORY}/External_module_usage_per_internal_module_aggregated_for_Typescript.csv"
7373
execute_cypher "${EXTERNAL_DEPENDENCIES_CYPHER_DIR}/External_module_usage_per_internal_module_distribution_for_Typescript.cypher" > "${FULL_REPORT_DIRECTORY}/External_module_usage_per_internal_module_distribution_for_Typescript.csv"
7474

75+
execute_cypher "${EXTERNAL_DEPENDENCIES_CYPHER_DIR}/List_external_modules_resolved_to_internal_ones_for_Typescript.cypher" > "${FULL_REPORT_DIRECTORY}/External_modules_resolved_to_internal_ones_for_Typescript.csv"
76+
7577
# Clean-up after report generation. Empty reports will be deleted.
7678
source "${SCRIPTS_DIR}/cleanupAfterReportGeneration.sh" "${FULL_REPORT_DIRECTORY}"

0 commit comments

Comments
 (0)