saveourtool/diktat

Rule: Create variable for long conditions and use them instead

Open

#829 opened on Apr 9, 2021

 (0 comments) (0 reactions) (0 assignees)Kotlin (40 forks)github user discovery
enhancementgood first issue

Repository metrics

Stars
 (571 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

In case of some long condition

if (cond1 && cond2 && cond3 && .....) {
}

It's better to create an additional variable for more readability

val condition = cond1 && cond2 && cond3 && .....
if (condition) {
}

Contributor guide