
org.sonar.plugins.vbnet.S3358.html Maven / Gradle / Ivy
Why is this an issue?
Nested ternaries are hard to read and can make the order of operations complex to understand.
Public Function GetReadableStatus(job As Job) As String
Return If(job.IsRunning, "Running", If(job.HasErrors, "Failed", "Succeeded")) ' Noncompliant
End Function
Instead, use another line to express the nested operation in a separate statement.
Public Function GetReadableStatus(job As Job) As String
If job.IsRunning Then Return "Running"
Return If(job.HasErrors, "Failed", "Succeeded")
End Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy