-
Notifications
You must be signed in to change notification settings - Fork 360
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
Report variables whose value is overwritten across multiple branches differently #4600
Comments
arichard4
pushed a commit
to arichard4/phan
that referenced
this issue
Oct 24, 2021
…m those unused or overwritten in one branch Closes phan#4600
arichard4
pushed a commit
to arichard4/phan
that referenced
this issue
Oct 24, 2021
…m those unused or overwritten in one branch Closes phan#4600
arichard4
pushed a commit
to arichard4/phan
that referenced
this issue
Oct 24, 2021
…m those unused or overwritten in one branch Closes phan#4600
arichard4
pushed a commit
to arichard4/phan
that referenced
this issue
Oct 24, 2021
…m those unused or overwritten in one branch Closes phan#4600
arichard4
pushed a commit
to arichard4/phan
that referenced
this issue
Oct 24, 2021
…m those unused or overwritten in one branch Closes phan#4600
arichard4
pushed a commit
to arichard4/phan
that referenced
this issue
Oct 25, 2021
…m those unused or overwritten in one branch Closes phan#4600
arichard4
pushed a commit
to arichard4/phan
that referenced
this issue
Oct 26, 2021
…m those unused or overwritten in one branch Closes phan#4600
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is for upstreaming code that I've had running on a branch of Phan for a few years; the question is whether you want this (and also the code quality, since I'm utterly unfamiliar with Phan's internals). I'll submit a PR shortly for more concrete discussion.
Phan draws a distinction between variables which are never defined, PhanUnusedVariable, and variables which are undefined in some reachable branches so far as Phan can tell, PhanPossiblyUndeclaredVariable. Phan also reports variable assignments that are never used. However, this interacts imperfectly with PhanUnusedVariable when considering multiple branches:
Some projects (e.g. mine) need to silence PhanPossiblyUndeclaredVariable due to a high rate of false positives and existing bad code; others are simply fine with the unused default value pattern. It would be nice if there was a way to silence the issue in test_unused without silencing all PhanUnusedVariables.
More specifically, if Phan reported a different issue type for when an assignment is unused because it is overwritten on multiple branches versus when it is either never accessed or overwritten without branches, projects that silence PhanPossiblyUndeclaredVariable could also silence the new issue type without suppressing other PhanUnusedVariable warnings.
The text was updated successfully, but these errors were encountered: