-
Notifications
You must be signed in to change notification settings - Fork 93
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 Inspection: Inform about Boolean Parameters #644
Conversation
Lgtm. @mccartney you ok to merge ? |
Do we have support for inspections being disabled by default? Anyway - I don't mind adding this inspection. I'd only seek for it not being on by default (which I am not sure if we have support for). |
Not really but the default list of disabled inspections could be changed to include this inspection. But that's not the nicest (but easy) solution.
Robert Martin argues that if the method takes a boolean parameter than it most probably does two things based on an
This becomes easily unnoticeable without enforcing named parameters. (I haven't found a way to add that as an inspection.)
I specifically added this inspection on |
Makes sense. Thanks for the context and the explanation. I think we are good to go. Also filing #646 to simplify things. All in all - I am happy to see your contributions. I am pretty sure Sam is happy too. |
I am happy :)
…On Mon, 2 May 2022 at 14:56, Greg Oledzki ***@***.***> wrote:
Merged #644 <#644> into
master.
—
Reply to this email directly, view it on GitHub
<#644 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGSS5AFLSUKIXBJGLYTVIAXPTANCNFSM5UMF3IKA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Could we maybe release a new minor version of scapegoat including this new inspection? |
Boolean parameters can easily lead to bugs. Especially if there are more than one.
This inspection informs about them, so developers can take a wise decision.
This has already been said by famous Robert C. Martin in Clean Code.
The formatting is part of #643 but this PR is based on the other to have working formatting.