You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to know what code in my project is unused, meaning I can remove it without breaking compilation or changing my apps' semantics (e.g. by deleting a custom toString).
Now, the above shouldn't in principle require any graphing.
I'm quite happy with achieving the above goal. A further goal might be to discover not just unused code, but all code that can be removed without affecting my apps.
For this purpose, I will of course need to specify the entry point to my apps (main methods). I'm assuming that then I will traverse the graph from these entry points and register all reachable entities. I will then subtract this list/set from the set of all entities traversed by the compiler.
This would yield better results, but it doesn't make sense to work on this until I've achieved the first goal in a satisfactory matter.
I think I've given a good high-level definition of what "unused" means to me ("I can remove it without breaking compilation or changing my apps' semantics").
This means that if entity A calls a method M, then M is used.
If M resides in a class C, then C is also used.
In the more global sense (my secondary goal), if A itself is unused, then M and C might be unused as well. In the local sense (my basic goal), M and C are used, period.
Seems simple to me on the face of it
The text was updated successfully, but these errors were encountered:
From @gtopper:
The text was updated successfully, but these errors were encountered: