Find unused code in a Rails app

后端 未结 11 1501
南方客
南方客 2020-12-01 02:35

How do I find what code is and isn\'t being run in production ?

The app is well-tested, but there\'s a lot of tests that test unused code.

11条回答
  •  孤城傲影
    2020-12-01 03:20

    This isn't a very proactive approach, but I've often used results gathered from New Relic to see if something I suspected as being unused had been called in production anytime in the past month or so. The apps I've used this on have been pretty small though, and its decently expensive for larger applications.

    I've never used it myself, but this post about the laser gem seems to talk about solving your exact problem.

提交回复
热议问题