Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.
void doSomething(int a, int b) { // "b" is unused
compute(a);
}
void doSomething(int a) {
compute(a);
}
Override and implementation methods are excluded, as are methods that are intended to be overridden.
@override
void doSomething(int a, int b) { // no issue reported on b
compute(a);
}
public void foo(String s) {
// designed to be extended but noop in standard case
}
protected void bar(String s) {
//open-closed principle
}
public void qix(String s) {
throw new UnsupportedOperationException("This method should be implemented in subclasses");
}