I'm using reek
as an analyzing tool for best practices in my code. However recently I found that if in the method, I have boolean parameters, such as.
def method (flag = true)
reek
gives me a warning. Why does reek
tell me that it is a warning?
A couple of years before I wrote reek I blogged about this code smell here: http://silkandspinach.net/2004/07/15/avoid-boolean-parameters/
The problems with Boolean parameters all have to do with duplication and the SRP: the called method has two responsibilities, and the caller knows which one it wants to invoke.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With