Inspectopedia Help

Nested conditional expression

Reports ternary conditional expressions that are nested inside other conditional expressions. Such nested conditionals may be very confusing. "Elvis" expressions are counted as conditionals for purpose of this inspection.


return (condition ? "result" : null) ?: "fail"

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Groovy, 241.14841

Last modified: 12 March 2024