Skip to content

Commit dee88e9

Browse files
committed
Add graph data science algorithms for Typescript
1 parent a9a33a4 commit dee88e9

File tree

5 files changed

+65
-0
lines changed

5 files changed

+65
-0
lines changed

scripts/reports/CentralityCsv.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,19 @@ if createDirectedJavaMethodDependencyProjection "${METHOD_PROJECTION}"; then
374374
runCentralityAlgorithms "${METHOD_PROJECTION}" "${METHOD_NODE}" "${METHOD_WEIGHT}"
375375
fi
376376

377+
# -- Typescript Modules Centrality -------------------------------
378+
379+
MODULE_LANGUAGE="dependencies_projection_language=Typescript"
380+
MODULE_PROJECTION="dependencies_projection=typescript-module-centrality"
381+
MODULE_NODE="dependencies_projection_node=Module"
382+
MODULE_WEIGHT="dependencies_projection_weight_property=lowCouplingElement25PercentWeight"
383+
384+
if createDirectedDependencyProjection "${MODULE_LANGUAGE}" "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"; then
385+
runCentralityAlgorithms "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"
386+
fi
387+
388+
# ---------------------------------------------------------------
389+
377390
# Clean-up after report generation. Empty reports will be deleted.
378391
source "${SCRIPTS_DIR}/cleanupAfterReportGeneration.sh" "${FULL_REPORT_DIRECTORY}"
379392

scripts/reports/CommunityCsv.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,20 @@ if createUndirectedJavaTypeDependencyProjection "${TYPE_PROJECTION}"; then
415415
execute_cypher "${CYPHER_DIR}/Community_Detection/Type_communities_with_few_members_in_foreign_packages.cypher" > "${FULL_REPORT_DIRECTORY}/Type_communities_with_few_members_in_foreign_packages.csv"
416416
execute_cypher "${CYPHER_DIR}/Community_Detection/Type_communities_that_span_the_most_packages_with_type_statistics.cypher" > "${FULL_REPORT_DIRECTORY}/Type_communities_that_span_the_most_packages_with_type_statistics.csv"
417417
fi
418+
419+
# -- Typescript Module Community Detection -----------------------
420+
421+
MODULE_LANGUAGE="dependencies_projection_language=Typescript"
422+
MODULE_PROJECTION="dependencies_projection=typescript-module-community"
423+
MODULE_NODE="dependencies_projection_node=Module"
424+
MODULE_WEIGHT="dependencies_projection_weight_property=lowCouplingElement25PercentWeight"
425+
MODULE_GAMMA="dependencies_leiden_gamma=1.14" # default = 1.00
426+
MODULE_KCUT="dependencies_maxkcut=20" # default = 2
427+
428+
if createUndirectedDependencyProjection "${MODULE_LANGUAGE}" "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"; then
429+
detectCommunities "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}" "${MODULE_GAMMA}" "${MODULE_KCUT}"
430+
fi
431+
418432
# ---------------------------------------------------------------
419433

420434
# Clean-up after report generation. Empty reports will be deleted.

scripts/reports/NodeEmbeddingsCsv.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,22 @@ if createUndirectedJavaTypeDependencyProjection "${TYPE_PROJECTION}"; then
190190
time nodeEmbeddingsWithNode2Vec "${TYPE_PROJECTION_DIRECTED}" "${TYPE_NODE}" "${TYPE_WEIGHT}" "${TYPE_DIMENSIONS}"
191191
fi
192192

193+
# -- Typescript Module Node Embeddings ---------------------------
194+
195+
MODULE_PROJECTION="dependencies_projection=typescript-module-embeddings"
196+
MODULE_PROJECTION_DIRECTED="dependencies_projection=typescript-module-directed-embeddings"
197+
MODULE_NODE="dependencies_projection_node=Module"
198+
MODULE_WEIGHT="dependencies_projection_weight_property=lowCouplingElement25PercentWeight"
199+
MODULE_DIMENSIONS="dependencies_projection_embedding_dimension=32"
200+
201+
if createUndirectedDependencyProjection "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"; then
202+
time nodeEmbeddingsWithFastRandomProjection "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}" "${MODULE_DIMENSIONS}"
203+
time nodeEmbeddingsWithHashGNN "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}" "${MODULE_DIMENSIONS}"
204+
205+
createDirectedDependencyProjection "${MODULE_PROJECTION_DIRECTED}" "${MODULE_NODE}" "${MODULE_WEIGHT}"
206+
time nodeEmbeddingsWithNode2Vec "${MODULE_PROJECTION_DIRECTED}" "${MODULE_NODE}" "${MODULE_WEIGHT}" "${MODULE_DIMENSIONS}"
207+
fi
208+
193209
# ---------------------------------------------------------------
194210

195211
# Clean-up after report generation. Empty reports will be deleted.

scripts/reports/SimilarityCsv.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,17 @@ if createDirectedJavaTypeDependencyProjection "${TYPE_PROJECTION}"; then
101101
time similarity "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}"
102102
fi
103103

104+
# -- Typescript Module Similarity -------------------------------------
105+
106+
MODULE_LANGUAGE="dependencies_projection_language=Typescript"
107+
MODULE_PROJECTION="dependencies_projection=typescript-module-similarity"
108+
MODULE_NODE="dependencies_projection_node=Module"
109+
MODULE_WEIGHT="dependencies_projection_weight_property=lowCouplingElement25PercentWeight"
110+
111+
if createDirectedDependencyProjection "${MODULE_LANGUAGE}" "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"; then
112+
time similarity "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"
113+
fi
114+
104115
# ---------------------------------------------------------------
105116

106117
# Clean-up after report generation. Empty reports will be deleted.

scripts/reports/TopologicalSortCsv.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ if createDirectedJavaTypeDependencyProjection "${TYPE_PROJECTION}" "${TYPE_NODE}
9292
time topologicalSort "${TYPE_PROJECTION}" "${TYPE_NODE}" "${TYPE_WEIGHT}"
9393
fi
9494

95+
# -- Typescript Module Topology ---------------------------------------
96+
97+
MODULE_LANGUAGE="dependencies_projection_language=Typescript"
98+
MODULE_PROJECTION="dependencies_projection=typescript-module-topology"
99+
MODULE_NODE="dependencies_projection_node=Module"
100+
MODULE_WEIGHT="dependencies_projection_weight_property=lowCouplingElement25PercentWeight"
101+
102+
if createDirectedDependencyProjection "${MODULE_LANGUAGE}" "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"; then
103+
time topologicalSort "${MODULE_PROJECTION}" "${MODULE_NODE}" "${MODULE_WEIGHT}"
104+
fi
105+
95106
# ---------------------------------------------------------------
96107

97108
# Clean-up after report generation. Empty reports will be deleted.

0 commit comments

Comments
 (0)