All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.plugins.vbnet.S3358.html Maven / Gradle / Ivy

There is a newer version: 10.5.0.109200
Show newest version

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