-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[apex] Feature/unused variable bind false positive with dynamic SOQL #4110
[apex] Feature/unused variable bind false positive with dynamic SOQL #4110
Conversation
Hi @adangel ! Would you have some tips on how to solve this issue ? I tried to take a look on ASTBindExpressions but not sure to fully understand how it works. |
Not sure, if it's that easy. Looking at the sample code with the Rule Designer shows, that the parsed AST doesn't use ASTBindExpression. The dynamic SOQL are plain strings (ASTLiteralExpression). I'm not familiar with Apex... how can you make dynamic SOQL to be executed? Is It seems, you need to start at the end, where some string is passed to a Apex function (a MethodCallExpression), that expects a SOQL - then you know, that the passed string must be a SOQL. And from there you need to go back and find the assignment/literals that make up the SOQL-string. Then you'd need to parse the SOQL yourself to get the var names out of it. |
Thanks for those guidelines, yes you're right dynamic SOQL are used with Thanks for your help ! |
Hi @tprouvot , how is it going with this? Do you think we could try schedule it for the next release (in a month)? Please let us know if you need any help. |
Hi @adangel, |
We can leave this PR in draft until it is ready - just wanted to hear back, whether you are still working on it. Regarding Designer and JavaFX - did you see #4153 (reply in thread) ? Maybe this helps... |
Hi @tprouvot , any news on this? Can we help? |
815f665
to
a03a55b
Compare
Generated by 🚫 Danger |
…alsePositive [apex] Feature/unused variable bind false positive with dynamic SOQL pmd#4110
Describe the PR
This PR fix the false positive issue on UnusedLocalVariable rule, when variable is used as bind variable in string soql query.
Related issues
Ready?
./mvnw clean verify
passes (checked automatically by github actions)