Pattern: Function only returning constant
Issue: -
A function that only returns a single constant can be misleading. Instead prefer to define the constant directly as a const val
.
Example of incorrect code:
fun functionReturningConstantString() = "1"
Example of correct code:
const val constantString = "1"