Skip to content
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

[reek] change config to ignore some pain points #1

Closed
wants to merge 1 commit into from

Conversation

foliea
Copy link

@foliea foliea commented Nov 28, 2018

No description provided.

@AliceLoeser
Copy link

As seen together, UtilityFunction can be annoying as well in an iterator, cf troessner/reek#681

MissingSafeMethod:
enabled: true
enabled: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bang means that the method is the dangerous version and that a safe version exist.
bang mean that there is a preferable and less dangerous version of the method.
Instead of remove this metric, just stop to use bang.

concat is a good example in ruby. It modify the receiver like map! or other methods with bang.
It is name concat and not concat!. There is not link between the modification of the receiver and the bang.

https://www.rubydoc.info/github/troessner/reek/Reek/Smells/PrimaDonnaMethod

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know but this is not followed at all in our codebase. It currently makes noise everywhere.

public_methods_only: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no change here. Do you want to change to public_methods_only: true?
It may be acceptable but I think we often use functional method that could be extract in a module.
For example, it is preferable to extract method that serialize or build an object because it is a specific responsibility.

UtilityFunction shows that there is a mix of responsibilities.

Copy link
Author

@foliea foliea Dec 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this one is not working properly. e.g Using a map on an instance variable and then using a method inside will trigger this cop. There is an issue open for a while on reek repository for that but currently this is a major bug IMO (check alice link above).

@lukkor lukkor closed this Sep 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants