Skip to content

Commit cee5fe8

Browse files
authored
Merge pull request #259 from JohT/fix/minor-typescript-issues
Fix minor Typescript issues
2 parents b15e2a7 + de8bf4f commit cee5fe8

File tree

4 files changed

+30
-49
lines changed

4 files changed

+30
-49
lines changed

cypher/Cyclic_Dependencies/Cyclic_Dependencies_Breakdown_Backward_Only_for_Typescript.cypher

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22

33
MATCH (module:TS:Module)-[:EXPORTS]->(forwardSource:TS)-[:DEPENDS_ON]->(forwardTarget:TS)<-[:EXPORTS]-(dependentModule:TS:Module)
44
MATCH (dependentModule)-[:EXPORTS]->(backwardSource:TS)-[:DEPENDS_ON]->(backwardTarget:TS)<-[:EXPORTS]-(module)
5-
// Get the project of the module if available
6-
OPTIONAL MATCH (project:Directory)<-[:HAS_ROOT]-(:TS:Project)-[:CONTAINS]->(module)
7-
OPTIONAL MATCH (dependentProject:Directory)<-[:HAS_ROOT]-(:TS:Project)-[:CONTAINS]->(dependentModule)
85
WHERE module.globalFqn <> dependentModule.globalFqn
9-
WITH project.absoluteFileName AS projectFileName
10-
,replace(
11-
module.globalFqn
12-
,project.absoluteFileName + '/', ''
13-
) AS moduleName
14-
,dependentProject.absoluteFileName AS dependentProjectFileName
15-
,replace(
16-
dependentModule.globalFqn
17-
,dependentProject.absoluteFileName + '/', ''
18-
) AS dependentModulePathName
19-
,collect(DISTINCT forwardSource.name + '->' + forwardTarget.name) AS forwardDependencies
20-
,collect(DISTINCT backwardTarget.name + '<-' + backwardSource.name) AS backwardDependencies
6+
// Get the project of the module if available
7+
OPTIONAL MATCH (project:TS:Project)-[:CONTAINS]->(module)
8+
OPTIONAL MATCH (dependentProject:TS:Project)-[:CONTAINS]->(dependentModule)
9+
WITH project.name AS projectFileName
10+
,module.localFqn AS moduleName
11+
,dependentProject.name AS dependentProjectFileName
12+
,dependentModule.localFqn AS dependentModulePathName
13+
,collect(DISTINCT forwardSource.name + '->' + forwardTarget.name) AS forwardDependencies
14+
,collect(DISTINCT backwardTarget.name + '<-' + backwardSource.name) AS backwardDependencies
2115
WITH projectFileName
2216
,moduleName
2317
,dependentProjectFileName

cypher/Cyclic_Dependencies/Cyclic_Dependencies_Breakdown_for_Typescript.cypher

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22

33
MATCH (module:TS:Module)-[:EXPORTS]->(forwardSource:TS)-[:DEPENDS_ON]->(forwardTarget:TS)<-[:EXPORTS]-(dependentModule:TS:Module)
44
MATCH (dependentModule)-[:EXPORTS]->(backwardSource:TS)-[:DEPENDS_ON]->(backwardTarget:TS)<-[:EXPORTS]-(module)
5-
// Get the project of the module if available
6-
OPTIONAL MATCH (project:Directory)<-[:HAS_ROOT]-(:TS:Project)-[:CONTAINS]->(module)
7-
OPTIONAL MATCH (dependentProject:Directory)<-[:HAS_ROOT]-(:TS:Project)-[:CONTAINS]->(dependentModule)
85
WHERE module.globalFqn <> dependentModule.globalFqn
9-
WITH project.absoluteFileName AS projectFileName
10-
,replace(
11-
module.globalFqn
12-
,project.absoluteFileName + '/', ''
13-
) AS moduleName
14-
,dependentProject.absoluteFileName AS dependentProjectFileName
15-
,replace(
16-
dependentModule.globalFqn
17-
,dependentProject.absoluteFileName + '/', ''
18-
) AS dependentModulePathName
19-
,collect(DISTINCT forwardSource.name + '->' + forwardTarget.name) AS forwardDependencies
20-
,collect(DISTINCT backwardTarget.name + '<-' + backwardSource.name) AS backwardDependencies
6+
// Get the project of the module if available
7+
OPTIONAL MATCH (project:TS:Project)-[:CONTAINS]->(module)
8+
OPTIONAL MATCH (dependentProject:TS:Project)-[:CONTAINS]->(dependentModule)
9+
WITH project.name AS projectFileName
10+
,module.localFqn AS moduleName
11+
,dependentProject.name AS dependentProjectFileName
12+
,dependentModule.localFqn AS dependentModulePathName
13+
,collect(DISTINCT forwardSource.name + '->' + forwardTarget.name) AS forwardDependencies
14+
,collect(DISTINCT backwardTarget.name + '<-' + backwardSource.name) AS backwardDependencies
2115
WITH projectFileName
2216
,moduleName
2317
,dependentProjectFileName

cypher/Cyclic_Dependencies/Cyclic_Dependencies_for_Typescript.cypher

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22

33
MATCH (module:TS:Module)-[:EXPORTS]->(forwardSource:TS)-[:DEPENDS_ON]->(forwardTarget:TS)<-[:EXPORTS]-(dependentModule:TS:Module)
44
MATCH (dependentModule)-[:EXPORTS]->(backwardSource:TS)-[:DEPENDS_ON]->(backwardTarget:TS)<-[:EXPORTS]-(module)
5-
// Get the project of the module if available
6-
OPTIONAL MATCH (project:Directory)<-[:HAS_ROOT]-(:TS:Project)-[:CONTAINS]->(module)
7-
OPTIONAL MATCH (dependentProject:Directory)<-[:HAS_ROOT]-(:TS:Project)-[:CONTAINS]->(dependentModule)
85
WHERE module.globalFqn <> dependentModule.globalFqn
9-
WITH project.absoluteFileName AS projectFileName
10-
,replace(
11-
module.globalFqn
12-
,project.absoluteFileName + '/', ''
13-
) AS moduleName
14-
,dependentProject.absoluteFileName AS dependentProjectFileName
15-
,replace(
16-
dependentModule.globalFqn
17-
,dependentProject.absoluteFileName + '/', ''
18-
) AS dependentModulePathName
19-
,collect(DISTINCT forwardSource.name + '->' + forwardTarget.name) AS forwardDependencies
20-
,collect(DISTINCT backwardTarget.name + '<-' + backwardSource.name) AS backwardDependencies
6+
// Get the project of the module if available
7+
OPTIONAL MATCH (project:TS:Project)-[:CONTAINS]->(module)
8+
OPTIONAL MATCH (dependentProject:TS:Project)-[:CONTAINS]->(dependentModule)
9+
WITH project.name AS projectFileName
10+
,module.localFqn AS moduleName
11+
,dependentProject.name AS dependentProjectFileName
12+
,dependentModule.localFqn AS dependentModulePathName
13+
,collect(DISTINCT forwardSource.name + '->' + forwardTarget.name) AS forwardDependencies
14+
,collect(DISTINCT backwardTarget.name + '<-' + backwardSource.name) AS backwardDependencies
2115
WITH projectFileName
2216
,moduleName
2317
,dependentProjectFileName

cypher/Typescript_Enrichment/Add_RESOLVES_TO_relationship_for_matching_modules.cypher

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ MATCH (module:TS:Module)<-[:CONTAINS]-(package:TS:Project)
77
WHERE module.globalFqn IS NOT NULL
88
AND EXISTS { (module)-[:EXPORTS]->(:TS) } // only when module exports something
99
MATCH (externalModule:TS:ExternalModule)
10-
WHERE module.globalFqn IS NOT NULL
10+
WHERE externalModule.globalFqn IS NOT NULL
1111
AND externalModule <> module
1212
AND externalModule.name = module.name // Base requirement: Same module name
1313
AND EXISTS { (externalModule)-[:EXPORTS]->(:TS:ExternalDeclaration)<-[]-(used:TS) } // only when external declarations are used
@@ -21,13 +21,12 @@ WHERE module.globalFqn IS NOT NULL
2121
// Find internal and external modules with identical "globalFqn"
2222
,(module.globalFqn = externalModule.globalFqn) AS equalGlobalFqn
2323
// Find internal and external modules with identical "module"
24-
,(module.module = externalModule.module) AS equalModule
24+
,(module.module = externalModule.module) AS equalModule
2525
// Find matching internal and external modules within the same package and namespace
26-
,( externalModule.namespace > ''
26+
,( externalModule.namespace <> ''
2727
AND externalModule.namespace = module.namespace
2828
AND externalModule.packageName = package.name
2929
AND normalizedExternalExtension = module.extensionExtended
30-
AND externalModule.globalFqn ENDS WITH module.localModulePath
3130
) AS equalNameAndNamespace
3231
// Find matching internal and external module without a namespace with matching local module path
3332
,( module.namespace = ''

0 commit comments

Comments
 (0)