Pattern: Unnecessary setter
Issue: -
Checks for explicit calls to setter methods which can, for the most part, be replaced by assignment to property. A setter is defined as a method call that matches set[A-Z] but not set[A-Z][A-Z] such as setURL()
. Setters take one method argument.
These bits of code produce violations:
x.setProperty(1)
x.setProperty(this.getA())
x.setProperty([])
These bits of code do not:
x.set(1)
x.setup(2)
x.setURL('')
x.setSomething('arg1', 'arg2')