-
Notifications
You must be signed in to change notification settings - Fork 63
M0-1-3
: Local variables that are used are reported as unused
#658
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
Comments
Root Cause
Fix Strategy(1) Consider the usage in array size in the getUseCountConservatively function like the following:
(2) Consider checking the usage of Parameter objects that have an access and logically same as the PotentiallyUnusedLocalVariable in UnusedVariable.qll like the following:
|
Thanks @rak3-sh! I think 1. seems sensible to me. For 2., I'd suggest applying some of the same restrictions as in 1. to ensure good performance:
|
Thanks @lcartey! Following are my observations for (2).
The modified fix that works for (2) looks like the following:
|
Another observation is that if I modify
|
Candidate fix is submitted at PR #660. |
Affected rules
Description
Local variables that are used are reported as unused. Please refer to the example for the sample scenarios.
Example
The text was updated successfully, but these errors were encountered: