Well, I removed two unused methods. I’ll call that a win.
More noise than signal for me here unfortunately. In ruby from rails meta magic (like overridden to to_param), helper methods used in unscanned haml, and libraries. In java from getters/setters.
Thanks for your help. Actually I did apt install cargo ctags-universal && cargo but it failed for me on compiling mimalloc.
I saw that there was some trickery in github actions for cross-build, then decided to try the release named linux-unknown-musl, because learning rust was totally out of scope for me today
I fought with Unused and Ctags, too, and need to move on with my day. It’s too bad—I could really use these tools in my workflow. I’d love to see more concrete documentation for specific use cases. I might mess with it more, but am calling this a bust for me, for now
7 files changed, 7 insertions(+), 18 deletions(-) with Vulture (on a polyglot project), thanks @vlcinsky for the suggestion. Had time to get unused to build and run, but not enough time to go through any of the 16k tokens in 1.3k files.
In addition it has me thinking of other kinds of dead code: Fully integrated, but unused from a user standpoint.
There is a ruby project called coverband which is meant to do simplecov sampling of a running production instance. Like test code coverage, but of user’s use. Now I’m sure there are performance considerations and I also want to keep in mind seasonality, there are some things in my applications that only get used once a year; wouldn’t want to remove a key feature just because it wasn’t used during the sampling window. I’ve never used it before, but I’m inspired to try it on one of my less mission-critical applications to see.
Has anyone else used a metrics approach to finding unused-by-users code?
Using Laravel, I’ve gone ahead and installed Nuno Maduros Larastan, which does static code analysis, fixed some type errors, and found out my app was providing a route which has never been used
This one was tricky b/c we actually do more meta-programming in this project than I was expecting! So the unused tool found a lot of instances of methods that are not explicitly referenced but computed. However I am much more familiar with meta-programming now.
Needless to say still a massive pile of model methods that were used for some A/B test somewhere or some now deprecated feature that could get tossed out.
This was the first time I used unused. It found possible hits that I’ll dig into another time. Even though I didn’t remove any unused code, I did get to start learning about a new tool.
I was able to double up with this one! The TODO that I found in the Day 2 exercise, just happened to be related to a section of code that was intended to be removed. I was able to just wipe out 38 lines
Seems that we have a lot of unused code floating around in our repo. Removed some but will definitely need to continue going through them over the next few weeks.