Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port/implement unusedness as sbt output #6

Open
matanox opened this issue Sep 27, 2015 · 0 comments
Open

port/implement unusedness as sbt output #6

matanox opened this issue Sep 27, 2015 · 0 comments

Comments

@matanox
Copy link
Owner

matanox commented Sep 27, 2015

From @gtopper:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant