Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Large Class should not count added methods from validations / associations in Rails

#40

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?

Reported by David Balatero · April 7th, 2009 @ 09:51 PM

State: resolved
Milestone: none
Assigned to: Kevin Rutherford Kevin Rutherford

Activity

  1. Kevin Rutherford
    Kevin Rutherford

    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.

    April 8th, 2009 @ 07:55 AM

  2. Kevin Rutherford
    Kevin Rutherford
    • State changed from new to resolved

    April 23rd, 2009 @ 07:33 PM

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.