Skip to content

Potential simplification of get_code_dependency #154

Closed
@m7pr

Description

@m7pr

A follow-up after #146 related to those 2 comments
#146 (comment)
#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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions