[clazy] [Bug 400504] New: Add new checker that warns about variables declared that are only used inside one of the branches on an if

Albert Astals Cid bugzilla_noreply at kde.org
Wed Oct 31 08:21:00 GMT 2018


https://bugs.kde.org/show_bug.cgi?id=400504

            Bug ID: 400504
           Summary: Add new checker that warns about variables declared
                    that are only used inside one of the branches on an if
           Product: clazy
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: unassigned-bugs at kde.org
          Reporter: aacid at kde.org
                CC: smartins at kde.org
  Target Milestone: ---

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

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Unassigned-bugs mailing list