Can I find out which classes are not used in a Ruby on Rails application?

In our project, we had some โ€œforgottenโ€ classes that lay for quite some time.

These classes have been replaced by others, but we forgot to remove them. Is there any automated way / tool to find out which classes are not used in a Ruby application {on Rails,}?

Thanks!

+6
source share
1 answer

This question has been asked many times, but the best answers are compiled here:

Find Unused Code in a Rails Application

I personally liked the log parsing:

fooobar.com/questions/94248 / ...

But in any case, you can create your own registrar that extends ActiveRecord :: Base to create an observer that stores the most used modules in the database. After prudential time, you can cancel the search for models that are not called even once.

There are other professional tools (paid) that determine the behavior of your application:

http://newrelic.com/

I used this project in a project and worked great on using a controller. You may find this helpful.

+2
source

Source: https://habr.com/ru/post/985131/


All Articles