-
Notifications
You must be signed in to change notification settings - Fork 394
PSUseDeclaredVarsMoreThanAssignments does not detect variables with multiple assignments #833
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
Thanks for reporting the case. However, it is a known issue that PSUseDeclaredVarsMoreThanAssignments can produce false positives for more than a year and there are several similar issues in this repo already. Given the low ressources on this project from the Microsoft side at the moment, it might take quite some time until PSUseDeclaredVarsMoreThanAssignments get fixed. Nevertheless it is still good to have all use cases collateted to help testing it should someone step into doing this ambitious task. |
…re than once to still give a warning. Issue 833: PowerShell#833
@JamesWTruher Can we consider closing this now that the PR is merged? |
definitely - I would rather @JohnLBevan do it (as he opened the issue). On the other hand, if you as the fixer want to close it, that's also fine. |
@JamesWTruher Although it would be great if the person raising this issue can sign this off, I do not think we can assume that everyone knows or has the time to compile PSSA themselves. I myself do not have rights to close issues as a community member... |
PSScriptAnalyzer correctly displays
PSUseDeclaredVarsMoreThanAssignments
given the following code:$someVariable = 'some value'
However, we can prevent this by declaring a type for variable a type. e.g.
The text was updated successfully, but these errors were encountered: