News

Signature matters!

In Scala, method signature semantics goes beyond method name, parameters and result type. The signature can also tell about whether a method has side effects, or whether a method represents a property.

However, sometimes we forget about writing proper definitions or method calls. That’s where 15 new method signature inspections may help. 

Method declaration syntax inspections

Method with Unit result type is parameterless:
Method with Unit result type is parameterless inspection

Method with Unit result type defined with equals sign:
Method with Unit result type defined with equals sign inspection

Method with Unit result type defined like function:
Method with Unit result type defined like function inspection

Redundant Unit result type annotation:
Redundant Unit result type annotation inspection

Apparent refinement of result type:
Apparent refinement of result type inspection

Method name inspections

Method with accessor-like name is empty-paren:
Method with accessor-like name is empty-paren inspection

Method with accessor-like name has Unit result type:
Method with accessor-like name has Unit result type inspection

Method with mutator-like name is parameterless:
Method with mutator-like name is parameterless inspection

Method overriding inspections

Empy-paren Scala method overriden as parameterless:
Empy-paren Scala method overriden as parameterless inspection

Parameterless Scala member overriden as empty-paren:
Parameterless Scala member overriden as empty-paren inspection

Java accessor method overriden as empty-paren:
Java accessor method overriden as empty-paren inspection

Java mutator method overriden as parameterless:
Java mutator method overriden as parameterless inspection

Method access inspections

Empty-paren method accessed as parameterless:
Empty-paren method accessed as parameterless inspection

Java accessor method called as empty-paren:
Java accessor method called as empty-paren inspection

Java mutator method accessed as parameterless:
Java mutator method accessed as parameterless inspection