Re:Uber open-sources tool to automatically clean up stale code
by mkr-plse on Monday June 22, 2020 @08:47AM
(#23599563)
Do you already know the code that is not executed? If not, dynamic program analyses can help with identify the regions of code that are untouched (e.g., take a look at javaagent for Java programs). Subsequently, you can use some form of reachability analysis to determine which code blocks to delete without causing a compilation failure.
We have quite a few online services in production of which I'm sure have a lot of code that isn't executed/touched by our users.
As an example I'm thinking about code in if statements that are never reached because the statement always returns False. These tools discussed aren't capable of detecting such stale code.
Any suggestions?