How to quickly detect unused greenrobot EventBus source code?

I have a complex Android project that needs to be reorganized. It implements many publishers and subscribers on greenrobot EventBus v3.0.0.
How to quickly detect unused source code or dead code?
Android Lint or other Java static scanning tools cannot detect them.

I found eventbus3-intellij-plugin , it might be useful to check Publish without subscription and Subscribe without messages .

I know that the root solution is to go through each code and view the code with colleagues.
I want to know if there are other tools or methods that can speed up this process.

+4
source share
1 answer

You can easily find unused resources from Android Studio. Just press Ctrl + Alt + Shift + i and enter “Unused resources” (without quotes). This will perform the lint. A super easy way to run lint commands (and other things from the IDE).

OR

In Android Studio → Menu → Refactoring → Delete Unused Resources ...

Select the resources you want to delete. You can exclude resources that you want to save by right-clicking on a resource element.

Use Do Refactor to delete all resources at once.

Update: use cmd+ Alt+ Shiftfor mac

+1

Source: https://habr.com/ru/post/1682184/


All Articles