-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[new cop] law of demeter #720
Comments
I think it's impossible for machines to detect violations of the law of Demeter. This code does not violate the law, but RuboCop cannot know whether the method chaining descends a hierarchy or is a fluent interface. def valid_method
@message.downcase.strip.gsub(' ', '_')
end |
True. I don't think it's possible handling this mechanically. |
these methods are just object modifications from standard library and active support |
@yltsrc You should know what static code analysis is. It does not provide runtime class information, so there's no way to differentiate methods with a same name but different implementations. |
read more to know why it is invalid code
The text was updated successfully, but these errors were encountered: