-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataMapper models trigger false positive Large Class #26
Comments
Ash, Thanks for helping me analyse this on Friday! Our conclusion was that there are in fact two problems here: First, LargeClass goes looking for the class in the object space, and if it finds it then it uses the in-memory class's method count. That shouldn't happen; the test should be based on the supplied chunk of source code. (Could you check that this is indeed occurring in your case? Please run the failing test on its own; if it passes, we know that reek is finding the class in memory from one of your other tests.) And second, LargeClass should be disabled for in-memory reek parsing. Raised separately as #28. |
Well I only just got my head round it at the end :) I will run the spec isolated in just a sec. But I remember we came to the conclusion that in general, the in-memory analysis will differ from the source-based analysis. eg my ugly bit of code:
So how would you write the documentation to help reek users decide when to do an analysis source-based and when to do it object-based? |
Behaviour confirmed: in a Merb app, the following line in
I have the following line at the top of my
I could replace this with:
But it will only take effect when that file is run in isolation. I guess I should wait for the bugfix? |
I believe this is fixed in e235ca9 (soon to be released as 1.1.3). |
Nudge me when 1.1.3 is out and I'll switch to the github gems to test it. |
Ashley pointed this release out to me, so I tested it in my environment it is indeed fixed. Many thanks. |
Good news -- thanks for the test! |
I get the following code smell with a DataMapper model:
I'm sure you'll agree the class doesn't have that many methods...
Similarly wacky numbers come out of all my other DM models, 37 being the highest...
The text was updated successfully, but these errors were encountered: