Nested @if, @else if, @else, @for, @while,
@each directives is a key ingredient for making what's known as "Spaghetti code". Such code is hard to
read, refactor and therefore maintain.
@if $x == 0 {
...
@if $y == 1 {
...
@while $z < 10 {
...
@if $a == 1 { /* Noncompliant: depth is 4 */
...
}
}
}
}
@if $x == 0 {
...
@if $y == 1 {
...
@while $z < 10 {
...
}
}
}