Scala

Scala

Made by DeepSource

Overridden methods cannot simply call super SC-R1049

Bug risk
Major

Methods are overridden in situations where the implementation/logic requires certain modifications. Overriding a method and simply calling super, i.e. the super class' implementation is redundant. It is therefore recommended that you either not override the method or modify your overriding logic.

Bad practice

class Child extends Parent {
  override def printName(): Unit = super.printName()
}

Recommended

class Child extends Parent {
  override def printName(): Unit = println("Child.printName()")
}