io.gitlab.arturbosch.detekt.rules.KtBinaryExpression.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of detekt-psi-utils Show documentation
Show all versions of detekt-psi-utils Show documentation
Static code analysis for Kotlin
package io.gitlab.arturbosch.detekt.rules
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.KtBinaryExpression
fun KtBinaryExpression.isNonNullCheck(): Boolean {
return operationToken == KtTokens.EXCLEQ && (left?.text == NULL_TEXT || right?.text == NULL_TEXT)
}
fun KtBinaryExpression.isNullCheck(): Boolean {
return operationToken == KtTokens.EQEQ && (left?.text == NULL_TEXT || right?.text == NULL_TEXT)
}
private const val NULL_TEXT = "null"
© 2015 - 2025 Weber Informatics LLC | Privacy Policy