I frequently am not sure if I can remove a method safely in an app that I work on at work. It is a dangling, forgotten method?
Firstly, I understand that if the app is well-tested, I wouldn't have this issue. But the reality is that the app is 9 years old and not well-tested.
Secondly, the issue is not as simple as just searching the code base for the method name for 3 reasons:
- Method names may be called via dynamic string concat, eg `obj.send("a_#{method}")
- We actually have a significant amount of ruby in our database that gets evaled, which (obviously) brittle and awful and hard to search.
- Some methods may be used only internal to other libraries, like
ransackable_scopes
So I'm looking for some way (maybe a gem) that once implemented, can track what methods have and haven't been called.
Any suggestions?