To compare an object with null prefer using ==. This rule detects and reports instances in the code where the equals() method is used to compare a value with null.
fun isNull(str: String) = str.equals(null)
fun isNull(str: String) = str == null
The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html