Skip to content

Long Function (ARCH9180)

Key swift.quality.long-method · Severity info · Category quality

Flags functions longer than 50 lines.

func process(_ order: Order) {
// 80 lines of validation, pricing, persistence and notification
}
func process(_ order: Order) throws {
try validate(order)
let priced = price(order)
try persist(priced)
notify(priced)
}

Extract cohesive steps into named functions.