Binary expressions are better expressed using an if expression than a when expression. See https://kotlinlang.org/docs/coding-conventions.html#if-versus-when
when (x) { null -> true else -> false}
if (x == null) true else false
The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html