Reports map
and getOrElse(false)
/ getOrElse(true)
and suggests replacing them with
exists
/ forall
.
Example:
def p(x: Int): Boolean = ???
Option(0).map(p).getOrElse(false)
Option(0).map(p).getOrElse(true)
After the quick-fix is applied:
def p(x: Int): Boolean = ???
Option(0).exists(p)
Option(0).forall(p)