In our project we had some "forgotten" classes lying around for quite some time.
Those classes were substituted by other ones but we forgot to delete them. Is there some automated way/tool to discover which classes are not being used in a Ruby {on Rails,} application?
Thanks !
This question has been made a lot of times, but the best answers are compiled in here:
Find unused code in a Rails app
I, personally, liked the log parsing:
https://stackoverflow.com/a/14161807
But in any case you can create your own logger extending ActiveRecord::Base to create an observer which stores in a database the most used modules. After a prudential time, you will be able to reverse find models that are not called even once.
There are other profesional tools (paid) that measures your app behaviour:
http://newrelic.com/
I've used this one in a project and did a great working measuring the controller usage. You might find it useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With