flyerhzm / rails_best_practices

a code metric tool for rails projects
http://rails-bestpractices.com
MIT License
4.16k stars 276 forks source link

RemoveUnusedMethodsInModelsCheck with define_method #275

Open gkopylov opened 8 years ago

gkopylov commented 8 years ago

There are some false positive when class have methods that defined by define_method. I dig a little deeper and found out that interesting_nodes (https://github.com/railsbp/rails_best_practices/blob/master/lib/rails_best_practices/prepares/model_prepare.rb#L9) doesn't contain any symbols for that. It probably must have :method_add_block, but I can not clear up yet how to fetch method name in this case.

Most likely this issue https://github.com/railsbp/rails_best_practices/issues/273 is bound to that too.