def bad_name?(name, _ctx)
var = name.to_s.gsub(/^[@\*\&]*/, '')
return false if accept_names.include?(var) # <- here is the problem!
reject_names.find { |patt| patt =~ var }
end
We only check for literals here, not for regexes.
The other Uncommunicative* smell detectors are not affected by the issue since they rightfully check for literals and regexes.
Found this bug while investigating #1058
Given this config.reek:
this:
shouldn't smell of UncommunicativeVariableName. Unfortunately it does:
The reason for this behaviour is here:
We only check for literals here, not for regexes. The other Uncommunicative* smell detectors are not affected by the issue since they rightfully check for literals and regexes.