Skip to content

Commit 2cf6997

Browse files
committed
Breaking rename RESOLVES_TO to IS_IMPLEMENTED_IN for Typescript modules.
1 parent ccfa33c commit 2cf6997

10 files changed

+14
-14
lines changed

cypher/Dependencies_Projection/Dependencies_0_Verify_Projectable.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
,(dependency[$dependencies_projection_weight_property]) AS weightPropertyValue
88
,(dependency[$dependencies_projection_weight_property] < 1) AS nonPositiveWeightPropertyValue
99
,coalesce(dependency.resolved, false) AS resolvedDependency
10-
,EXISTS { (target)<-[:RESOLVES_TO]-(resolvedTarget:ExternalModule) } AS resolvedTarget
10+
,EXISTS { (target)<-[:IS_IMPLEMENTED_IN]-(resolvedTarget:ExternalModule) } AS resolvedTarget
1111
,(source.incomingDependencies IS NULL OR
1212
target.incomingDependencies IS NULL) AS missingIncomingDependencies
1313
,(source.outgoingDependencies IS NULL OR

cypher/DependsOn_Relationship_Weights/Add_fine_grained_weights_for_Typescript_external_module_dependencies.cypher

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
MATCH (source:TS:Module)-[moduleDependency:DEPENDS_ON]->(target:ExternalModule)
55
// Exclude all targets where an ExternalModule was found that resolves to them
66
// because those are covered in the fine grained weights for "ExternalModule"s.
7-
WHERE NOT EXISTS { (target)-[:RESOLVES_TO]->(source) }
8-
OPTIONAL MATCH (source)-[resolvedModuleDependency:DEPENDS_ON]->(resolvedTarget:TS:Module)<-[:RESOLVES_TO]-(target)
7+
WHERE NOT EXISTS { (target)-[:IS_IMPLEMENTED_IN]->(source) }
8+
OPTIONAL MATCH (source)-[resolvedModuleDependency:DEPENDS_ON]->(resolvedTarget:TS:Module)<-[:IS_IMPLEMENTED_IN]-(target)
99
WITH source
1010
,target
1111
,moduleDependency
@@ -24,7 +24,7 @@ OPTIONAL MATCH (source)-[rd:DEPENDS_ON]->(declaration:ExternalDeclaration)<-[:EX
2424
,collect(declaration) AS declarations
2525
// Get optional low coupling elements (TypeAlias, Interface) that the source module contains and defines (low level) that depend on the external module (target)
2626
UNWIND declarations AS declaration
27-
OPTIONAL MATCH (source)-[ra:DEPENDS_ON]->(declaration)-[:RESOLVES_TO]->(abstractType:TypeAlias|Interface)
27+
OPTIONAL MATCH (source)-[ra:DEPENDS_ON]->(declaration)-[:IS_IMPLEMENTED_IN]->(abstractType:TypeAlias|Interface)
2828
WITH source
2929
,target
3030
,moduleDependency

cypher/DependsOn_Relationship_Weights/Add_fine_grained_weights_for_Typescript_internal_module_dependencies.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
WHERE moduleDependency.declarationCount IS NULL
88
// Ruling out resolved targets also filters out entries that aren't covered by the fine grained weights for "ExternalModule"s.
99
// Therefore, the exists filter is commented out for now and replaced by focussing on missing detailed weight properties to catch them all.
10-
//WHERE NOT EXISTS { (target)<-[:RESOLVES_TO]-(resolvedTarget:ExternalModule) }
10+
//WHERE NOT EXISTS { (target)<-[:IS_IMPLEMENTED_IN]-(resolvedTarget:ExternalModule) }
1111
WITH source
1212
,target
1313
,moduleDependency

cypher/External_Dependencies/List_external_modules_resolved_to_internal_ones_for_Typescript.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Statistics about how many ExternalModule nodes were found that match internal Module nodes
22

3-
MATCH (module:TS:Module)<-[resolved:RESOLVES_TO]-(external:TS:ExternalModule)
3+
MATCH (module:TS:Module)<-[resolved:IS_IMPLEMENTED_IN]-(external:TS:ExternalModule)
44
OPTIONAL MATCH (project:TS:Project)-[:CONTAINS]->(module)
55
WITH project.name AS projectName
66
,count(DISTINCT module) AS resolvedModuleCount

cypher/Metrics/Set_Outgoing_Typescript_Module_Dependencies.cypher

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// Get the top level dependency between a Typescript module and an external modules it uses
44
MATCH (source:TS:Module)
55
OPTIONAL MATCH (source)-[moduleDependency:DEPENDS_ON]->(target:ExternalModule)
6-
WHERE NOT EXISTS {(target)-[:RESOLVES_TO]->(source)}
6+
WHERE NOT EXISTS {(target)-[:IS_IMPLEMENTED_IN]->(source)}
77
// Get the project of the external module if available
8-
OPTIONAL MATCH (projectdir:Directory)<-[:HAS_ROOT]-(project:TS:Project)-[:CONTAINS]->(:TS:Module)<-[:RESOLVES_TO]-(target)
8+
OPTIONAL MATCH (projectdir:Directory)<-[:HAS_ROOT]-(project:TS:Project)-[:CONTAINS]->(:TS:Module)<-[:IS_IMPLEMENTED_IN]-(target)
99
// Aggregate all gathered information for each (grouped by) source module
1010
WITH source
1111
,collect(DISTINCT projectdir.absoluteFileName) AS projectNames

cypher/Typescript_Enrichment/Add_DEPENDS_ON_relationship_to_resolved_modules.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Inspired by https://github.com/jQAssistant/jqassistant/blob/4cd7face5d6d2953449d8e6ff5b484f00ffbdc2f/plugin/java/src/main/resources/META-INF/jqassistant-rules/java-classpath.xml#L5
33

44
MATCH (module:TS:Module)-[dependsOn:DEPENDS_ON]->(externalModule:TS:ExternalModule)
5-
MATCH (externalModule)-[:RESOLVES_TO]->(resolvedModule:TS:Module)
5+
MATCH (externalModule)-[:IS_IMPLEMENTED_IN]->(resolvedModule:TS:Module)
66
WHERE module <> resolvedModule
77
CALL { WITH module, dependsOn, resolvedModule
88
MERGE (module)-[resolvedDependsOn:DEPENDS_ON]->(resolvedModule)

cypher/Typescript_Enrichment/Add_IS_IMPLEMENTED_IN_relationship_for_matching_declarations.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Link matching external to internal Typescript declarations with an IS_IMPLEMENTED_IN relationship
22

33
MATCH (externalModule:TS&ExternalModule)-[:EXPORTS]->(externalDeclaration:TS&ExternalDeclaration)
4-
MATCH (externalModule)-[:RESOLVES_TO]->(internalModule:TS&Module)
4+
MATCH (externalModule)-[:IS_IMPLEMENTED_IN]->(internalModule:TS&Module)
55
MATCH (externalModule)-[:EXPORTS]->(internalDeclaration:TS&!ExternalDeclaration)
66
WHERE externalDeclaration.name = internalDeclaration.name
77
WITH externalDeclaration, internalDeclaration

cypher/Typescript_Enrichment/Add_RESOLVES_TO_relationship_for_matching_modules.cypher renamed to cypher/Typescript_Enrichment/Add_IS_IMPLEMENTED_IN_relationship_for_matching_modules.cypher

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Adds a relation "RESOLVES_TO" from an external module to a module if their global fully qualified names match.
1+
// Adds a relation "IS_IMPLEMENTED_IN" from an external module to a module if their global fully qualified names match.
22
// Depends on "Add_module_properties.cypher" to be run first
33
// Inspired by https://github.com/jQAssistant/jqassistant/blob/4cd7face5d6d2953449d8e6ff5b484f00ffbdc2f/plugin/java/src/main/resources/META-INF/jqassistant-rules/java-classpath.xml#L5
44
// Related to https://github.com/jqassistant-plugin/jqassistant-typescript-plugin/issues/35
@@ -47,7 +47,7 @@ WHERE equalGlobalFqn
4747
OR equalNameWithoutNamespace
4848
OR equalNameAndNpmPackage
4949
CALL { WITH module, externalModule
50-
MERGE (externalModule)-[:RESOLVES_TO]->(module)
50+
MERGE (externalModule)-[:IS_IMPLEMENTED_IN]->(module)
5151
} IN TRANSACTIONS
5252
RETURN CASE WHEN equalGlobalFqn THEN 'equalGlobalFqn'
5353
WHEN equalModule THEN 'equalModule'

cypher/Typescript_Enrichment/Count_internal_modules_resolving_external_ones.cypher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
WITH count(internal_module) AS totalNumberOfInternalModules
55
,collect(internal_module) AS internal_modules
66
UNWIND internal_modules AS internal_module
7-
MATCH (external_module:TS:ExternalModule)-[:RESOLVES_TO]->(internal_module)
7+
MATCH (external_module:TS:ExternalModule)-[:IS_IMPLEMENTED_IN]->(internal_module)
88
WHERE NOT external_module.isNodeModule = true
99
RETURN totalNumberOfInternalModules
1010
,COUNT { (all_external_modules:TS:ExternalModule)

scripts/prepareAnalysis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Link_external_modules_to_corresponding_
9090
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_namespace_property_on_nodes_from_linked_npm_packages.cypher"
9191

9292
# Preparation - Enrich Graph for Typescript by adding relationships between Modules with the same globalFqn
93-
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_RESOLVES_TO_relationship_for_matching_modules.cypher"
93+
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_IS_IMPLEMENTED_IN_relationship_for_matching_modules.cypher"
9494
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_IS_IMPLEMENTED_IN_relationship_for_matching_declarations.cypher"
9595
execute_cypher "${TYPESCRIPT_CYPHER_DIR}/Add_DEPENDS_ON_relationship_to_resolved_modules.cypher"
9696

0 commit comments

Comments
 (0)