-
Notifications
You must be signed in to change notification settings - Fork 58
refactor complex non-method code in Reservation #346
Comments
_Update:_ CodeClimate currently gives the non-methods areas of the Reservations model a complexity score of 152. I'm not entirely sure what there is to refactor outside of the methods. The scopes are a bit long, yes, but most (if not all) of them are entirely necessary (we should grep for these #635). We can look into rewriting them and deleting unused scopes, but.. everything else is commented to explain why it's there and what it's doing. We can't exactly run the app without validations. |
That's about all I can see. If someone investigates the first point than we can probably just close this |
I was thinking about this and I actually think that, semantically, scopes might belong in a helper, or a helper-like separation. On a relevant note, there's an argument for ditching them altogether and substituting them with arel calls. The upside would be that the scopes would be actually defined as methods and thus be subject to the standard lookup. But that might just be useless equivocation at this point, plus that post is from 2010. |
The post you liked to basically says in the update at the end that it's a matter of personal preference. Also, don't forget, that CodeClimate is looking at the master branch, so a lot of the recent changes to the |
CodeClimate gives the non-method code in Reservations a complexity rating of 150... yikes
The text was updated successfully, but these errors were encountered: