| Summary: | Add new checker that warns about variables declared that are only used inside one of the branches on an if | ||
|---|---|---|---|
| Product: | [Developer tools] clazy | Reporter: | Albert Astals Cid <aacid> |
| Component: | general | Assignee: | Sergio Martins <smartins> |
| Status: | REPORTED --- | ||
| Severity: | wishlist | CC: | smartins |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
It would need to be whitelist based like unused-non-trivial-variable I would like a test that warns you if you have stuff like QFileInfo obj; if (bla) { // use obj } else { // don't use obj } And tell you to move the obj declaration inside the first if block