Open Vampire opened 4 years ago
Another workaround is to set checkIsMethods to false on that rule. But I acknowledge that still is not great.
The challenge is that this is a simple rule that does not know the types of the objects on which the methods are being called. I think we'd have to switch it to an enhanced (or hybrid) rule to get the information needed to know whether it was acting upon a Map.
CodeNarc 1.4 complains about an
isEmpty()
call on a map and suggests to useempty
instead. But that cannot work, as that gets the value for the key'empty'
and does not query theisEmpty()
method.Work-around is to use the
ignoreMethodNames
property.