Default severity: warning
Reports control flow nested more than five levels deep. Guard clauses and cohesive helper functions usually make the same decisions easier to follow.
Bad
if first {
if second {
if third {
if fourth {
if fifth {
if sixth {
process()
}
}
}
}
}
}Good
if !ready {
return
}
for _, item := range items {
process(item)
}