saveourtool/diktat

Rule: Create variable for long conditions and use them instead

Open

#829 创建于 2021年4月9日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)Kotlin (40 fork)github user discovery
enhancementgood first issue

仓库指标

Star
 (571 star)
PR 合并指标
 (PR 指标待抓取)

描述

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) {
}

贡献者指南