Large Class should not count added methods from validations / associations in Rails
Reported by David Balatero | April 7th, 2009 @ 09:51 PM
Given an ActiveRecord model with a number of validations and associations added, and no extra methods, the method count can balloon to larger than the max count really fast.
I believe this is because validates*of-type methods in Rails add methods to the class itself, so they don't get seen as separate modules / inherited methods.
Would there be a way to whitelist some of these generated methods?
Comments and changes to this ticket
-
Kevin Rutherford April 8th, 2009 @ 07:55 AM
There's no way to whitelist individual methods so they don't contribute to the class size. There's also no way to increase the size threshold on a per-class basis. But you can use a .reek file to whitelist the class against the LargeClass smell; see the wiki page at http://wiki.github.com/kevinruth... for hints.
-
Kevin Rutherford April 23rd, 2009 @ 07:33 PM
- State changed from new to resolved
Transferred to http://github.com/kevinrutherfor.../24
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Defects and feature requests for <a href="http://wiki.github.com/kevinrutherford/reek">Reek</a>, the Ruby code smell detector