-
Notifications
You must be signed in to change notification settings - Fork 382
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
Question about 'PSUseDeclaredVarsMoreThanAssignment' rule #636
Comments
The first violation is not correct but it is a due to the limitation of the rule's implementation - It doesn't inspect downstream scopes for a variable's use. The second case is a bug |
Moving this to backlog as the the current solution (in #655) to this problem is more of a patchwork and error prone. In order to solve this problem properly, we need to make use of techniques like SSA. PSSA currently has an implementation but that needs to be updated in order to use it in this context. Once we have that capability, we will fix this issue. |
I found today that Changing it to |
I also encountered the Any comments about whether this is something that should be avoided or whether it's just not being understood properly and is a false positive? |
This is a false positive. Sorry about not having a clear guidance as to when this will be fixed. We will push a fix soon, hopefully by the end of May or early June. |
Duplicate of #1163 |
This code triggers a violation :
This one too :
But not this one :
It is the first violation correct ?
The text was updated successfully, but these errors were encountered: