Skip to content

Should DEPENDS_ON cardinality between Module and ExternalModule include ExternalDeclarations? #33

@JohT

Description

@JohT

Hey 👋,

i've recognized that ExternalDeclaration cardinality isn't included in the sum of cardinalities of the DEPENDS_ON relationship between a Module and an ExternalModule. Everything else that Module declares or depends on seems to be included as i'd expect.

Here is a picture of an example from the analysis of ts-output-react-router.json with the example-query.cypher:

example-graph
  • DEPENDS_ON relationships are displayed with their cardinalities
  • The orange ìndex.ts node is the Module
  • The grey history.ts node is the ExternalModule
  • The blue and green nodes are elemens that are declared by Module and depend on ExternalModule. Their cardinalities sum up to 4 which equals the cardinality between Module and ExternalModule.
  • The purple nodes are labeled ExternalDeclaration. They are exported by the ExternalModule and used within the ExternalModule. Their cardinalities (2x2=4) between Module and ExternalDeclaration are not included in the sum of cardinalities between Module and ExternalModule.

To rephrase that in cypher language 😀:

  • module_rel.cardinality of (source:TS:Module)-[module_rel:DEPENDS_ON]->(target:TS:ExternalModule) contains the sum of cardinalities between those modules
  • The sum above contains all element_rel.cardinality of (source)-[:DECLARES]->(element)-[element_rel:DEPENDS_ON]->(target)
  • The sum above does not contain declaration_rel.cardinality of (source)-[declaration_rel:DEPENDS_ON]->(declaration:ExternalDeclaration)<-[:EXPORTS]-(target)

What is reason for leaving out external declaration dependencies between modules or is this unintentional?

Thank you very much 🙏,
Johannes

By the way: Awesome plugin for Typescript 👍. I'm trying to integrate it into my code-graph-analysis-pipeline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions