KT.DESTRUCTURING_DECLARATION_WITH_TOO_MANY_ENTRIES
Destructuring declaration with too many entries
Destructuring declarations with too many entries are hard to read and understand. To increase readability they should be refactored to reduce the number of entries or avoid using a destructuring declaration.
Noncompliant Code
Copy
data class TooManyElements(val a: Int, val b: Int, val c: Int, val d: Int)
val (a, b, c, d) = TooManyElements(1, 2, 3, 4)
Compliant Code
Copy
data class FewerElements(val a: Int, val b: Int, val c: Int)
val (a, b, c) = TooManyElements(1, 2, 3)
Options
-
maxDestructuringEntries
(default:3
)maximum allowed elements in a destructuring declaration