You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 23, 2024. It is now read-only.
lukarade
changed the title
feat: resolve reference for multiple imports and imports with aliases
feat: infer purity of imported functions (and names)
Feb 27, 2024
…#238)
Closes#171#225#237
### Summary of Changes
After reviewing the new `resolve_references` approach, we found that
`build_call_graph` and thus `infer_purity` could also be optimised.
`built_call_graph` now uses the new `CallGraphBuilder` class and an
improved recursive approach to build a call graph from a
`Reasons`object:
First the data for classes is pre-processed, so that the `__init__` are
linked to their respective class.
Then, a function iterates over all `Reasons` objects and adds either a
`CallGraphNode` - for self defined functions and builtins, a
`CombinedCallGraphNode` - for a node that represents a cycle of
functions or an `ImportedCallGraphNode` - for imported functions to the
call graph. When a node is edited, all calls of that node are added as
children to that node.
`infer_purity` now uses the new `PurityAnalyzer` class to analyze the
call graph for impurity.
As before, all reasons for impurity are detected by first analyzing the
children of a `CallGraphNode` and propagating their results, before
analyzing the node itself. Imported nodes are treated separately.
Combined nodes are decombined to their original functions, and the
results of the combined node is transferred.
---------
Co-authored-by: megalinter-bot <[email protected]>
Is your feature request related to a problem?
Currently, references for imported functions and names are not detected.
Therefor their impact on the purity result is not put into consideration.
Desired solution
The text was updated successfully, but these errors were encountered: