Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Consider function arity when resolving references. #252

Closed
lukarade opened this issue Apr 20, 2024 · 0 comments · Fixed by #254
Closed

Consider function arity when resolving references. #252

lukarade opened this issue Apr 20, 2024 · 0 comments · Fixed by #254
Assignees
Labels
enhancement 💡 New feature or request purity Inferring the purity of functions

Comments

@lukarade
Copy link
Contributor

Is your feature request related to a problem?

Currently, the reference from a call to a function def is resolved by simply comparing the name of the call to the name of the def.
If there are many function defs with the same name, they are all referenced.

Desired solution

The results are most likely to improve if only functions with the same number of parameters (=arity) are referenced.
Therefore, a check must be implemented that compares the number of parameters of a call to the number of arguments of a function def.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

Functions with star arguments (*args | **kwargs) require special treatment.

@lukarade lukarade added enhancement 💡 New feature or request purity Inferring the purity of functions labels Apr 20, 2024
@lukarade lukarade self-assigned this Apr 20, 2024
@lukarade lukarade linked a pull request Apr 26, 2024 that will close this issue
lars-reimann pushed a commit that referenced this issue May 1, 2024
Closes #252

### Summary of Changes

Implemented a function that compares the arguments of a call with the
parameters of the function when resolving function references. It checks
the arity of the call and the names of the keyword arguments (if any) to
reduce the possible references for function calls where more than one
function def matches by name.

---------

Co-authored-by: megalinter-bot <[email protected]>
@github-project-automation github-project-automation bot moved this from Backlog to ✔️ Done in Library Analysis May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement 💡 New feature or request purity Inferring the purity of functions
Projects
Status: ✔️ Done
Development

Successfully merging a pull request may close this issue.

1 participant