Thanks for the suggestion. I just took a look at https://github.com/SonarSource/sonarqube <https://github.com/SonarSource/sonarqube>. It looks like SonarQube can only be applied for Gradle projects?
Thanks, Yunze > 2021年12月10日 下午6:11,Yufei Zhang <affei...@gmail.com> 写道: > > Hi, > > My previous team used SonarQube for detecting such issues. I saw a free > version can be used. Also there is sonarlint for local checks which i found > useful. > > Cheers > Yufei > > On Fri, Dec 10, 2021 at 6:08 PM Yunze Xu <y...@streamnative.io.invalid> > wrote: > >> Hi, all >> >> Recently I found a bug that could be avoided if we have a CI to detect >> unused >> variables. See https://github.com/apache/pulsar/pull/13233 < >> https://github.com/apache/pulsar/pull/13233>. We can see the >> private field `recycleHandle` was not used before this PR. >> >> Generally, we should avoid all unused private fields except some special >> cases >> like `AtomicIntegerFieldUpdater`, while the warning should be suppressed by >> `@SuppressWarnings(“unused”)`. >> >> I see checkstyle plugins are still not applied for all modules, so the >> code quality >> Is not guaranteed well. BTW, I found checkstyle plugin cannot detect unused >> variables. >> >> Does anyone know any plugin to do this work? There is much work to enhance >> our code quality. >> >> Thanks, >> Yunze