Finding Unused Code in Rails

Using rcov along with your tests is great - you can quickly identify untested code. But what if you want to find unused code? Just because you have a test written for a method doesn't mean you're using it in your application.

rcov script/server

Start WEBrick through rcov, and click through your application. When you're done you'll have a coverage report identifying any unused code. This is a great way to make sure you're not calling that deprecated method before you actually delete it.