Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential simplification of get_code_dependency #192

Closed
m7pr opened this issue Nov 21, 2023 · 0 comments · Fixed by #201
Closed

Potential simplification of get_code_dependency #192

m7pr opened this issue Nov 21, 2023 · 0 comments · Fixed by #201
Assignees

Comments

@m7pr
Copy link
Contributor

m7pr commented Nov 21, 2023

Feature description

A follow-up after insightsengineering/teal.code#146 related to those 2 comments
insightsengineering/teal.code#146 (comment)
insightsengineering/teal.code#146 (comment)

In the current format, get_code_dependency() works on code_dependency() that creates a structure of the dependency of objects found within the code. code_dependency() returns a named list of length 3. There is an idea that this list can be simplified to length 1. This list contains

  • occurence named list (names after all found symbols in the code) with integer vectors specifying in which call a symbol appeared
  • cooccurrence a list of length equal to the number of calls in input code, each element contains names of symbols appearing in this call. symbols are ordered so that the first element is the affected object
  • effects a named list (the same as occurence) specifying where linksto tags appeared for a specific object
  1. occurence and effects could be merged into the same list
  2. occurence and effects could be merged into cooccurence - if there is just one object in an element of the list, this is just an occurence or an effect. if there are more then this is cooccurrence. we need to sort out what if there is a cooccurrence that has an effect which will actually impact 2 objects (the affected and the one tagged with linksto
  3. what if linktso has multiple objects ?
  4. detect_symbol can be then used once (for cooccurrence and occurrence)

cooccurence could be a list of length equal to the number of call, where each element is a list containing 2 fields

  • influenced - objects being impacted by this line
  • influencers - object having an impact on this line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants