Find all unused variable

前端 未结 4 1316
鱼传尺愫
鱼传尺愫 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条回答
  •  粉色の甜心
    2021-02-08 22:22

    You could run something like FindBugs on it.

    FindBugs

    Looking at the bug list it has

    UuF: Unused field (UUF_UNUSED_FIELD) This field is never used. Consider removing it from the class.

    You could filter on just this, but it is a good idea to run this on all code all the time, it is amazing what it finds.

提交回复
热议问题