Long Function (ARCH8180)
Esta página aún no está disponible en tu idioma.
Key kotlin.quality.long-method · Severity info · Category quality
Flags functions longer than 50 lines, or @Composable functions longer than 150 - a composable is a declarative UI tree, and its length measures how much UI it declares.
Incorrect
Section titled “Incorrect”fun process(order: Order) { // 80 lines of validation, pricing, persistence and notification}Correct
Section titled “Correct”fun process(order: Order) { validate(order) val priced = price(order) persist(priced) notify(priced)}Extract cohesive steps into named functions.