SONARPY-740 Rule S5756: Calls should not be made to non-callable values#782
Merged
guillaume-dequenne merged 2 commits intomasterfrom Jun 11, 2020
Merged
SONARPY-740 Rule S5756: Calls should not be made to non-callable values#782guillaume-dequenne merged 2 commits intomasterfrom
guillaume-dequenne merged 2 commits intomasterfrom
Conversation
7ea3955 to
4782cb2
Compare
4782cb2 to
2065424
Compare
andrea-guarino-sonarsource
approved these changes
Jun 11, 2020
| dict_var() # Noncompliant | ||
|
|
||
| set_var = set() | ||
| set_var() # FN (set has unresolved type hierarchy) |
Contributor
There was a problem hiding this comment.
maybe we can hardcode it in the rule?
Contributor
Author
There was a problem hiding this comment.
Done in aaaac0c. That said, I assume there will be many other types in that situation.
| CallExpression callExpression = (CallExpression) ctx.syntaxNode(); | ||
| Expression callee = callExpression.callee(); | ||
| if (!callee.type().canHaveMember("__call__")) { | ||
| Optional<String> nameOptional = nameFromExpression(callee); |
Contributor
There was a problem hiding this comment.
minor: I think I would prefer nameFromExpression to return null in this case
a9e8289 to
aaaac0c
Compare
|
Kudos, SonarQube Quality Gate passed! |
hashicorp-vault-sonar-prod Bot
pushed a commit
that referenced
this pull request
Jan 22, 2026
… to all network interfaces (#782) GitOrigin-RevId: f9bd468fa03d1459f01f81425e6c0ecc2746f83a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current implementation is missing secondary locations: they will be introduced through a new API based on flow sensitive type inference.