Find all unused variable

前端 未结 4 1334
鱼传尺愫
鱼传尺愫 2021-02-08 21:36

Normally it\'s easy to see unused variables in Netbeans, just a grey squiggly line.

But how would I find all of these unused variables in my project or of a single clas

4条回答
  •  Happy的楠姐
    2021-02-08 22:27

    The compiler will warn about unused variables giving you your list.

    Unused method variables will be removed by the compiler but unused member variables remain, which depending on the state of your codebase may make this a cosmetic problem that can be handled as and when each file is modified rather than a conserted effort to remove all unused variables in one go.

    Saying that, I generally like my builds to run with no warnings, so that when I genuinely break something I notice the warning. Maybe this is the clean-up you are looking for ;-)

提交回复
热议问题