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.
…#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?
Since the new call graph calculation was implemented, the purity inference does not work anymore.
Desired solution
With the changes to the call graph calculation in mind, the analysis can be changed to be easier to understand and probably a lot more efficient.
Possible alternatives (optional)
No response
Screenshots (optional)
No response
Additional Context (optional)
No response
The text was updated successfully, but these errors were encountered: