Type | Scope | Severity | Activated by default |
Minutes to fix |
Tags |
---|---|---|---|---|---|
Code smell |
BSL OS |
Major |
Yes |
5 |
brainoverload |
Use of nested ternary operators decrease code readability.
Result = ?(X%15 <> 0, ?(X%5 <> 0, ?(X%3 <> 0, x, "Fizz"), "Buzz"), "FizzBuzz");
If ?(P.Emp_emptype = Null, 0, PageEmp_emptype) = 0 Then
Status = "Done";
EndIf;
If x % 15 = 0 Then
Result = "FizzBuzz";
ElseIf x % 3 = 0 Then
Result = "Fizz";
ElseIf x % 5 = 0 Then
Result = "Buzz";
Else
Result = x;
EndIf;
If PageEmp_emptype = Null OR PageEmp_emptype = 0 Then
Status = "Done";
End If;
// BSLLS:NestedTernaryOperator-off
// BSLLS:NestedTernaryOperator-on
"NestedTernaryOperator": false