rspec/rules/S3358/vbnet/rule.adoc

40 lines
785 B
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 12:48:39 +02:00
include::../description.adoc[]
=== Noncompliant code example
2020-06-30 12:48:39 +02:00
2022-02-04 17:28:24 +01:00
[source,vbnet]
2020-06-30 12:48:39 +02:00
----
Public Function GetReadableStatus(job As Job) As String
Return If(job.IsRunning, "Running", If(job.HasErrors, "Failed", "Succeeded")) ' Noncompliant
2020-06-30 12:48:39 +02:00
End Function
----
=== Compliant solution
2020-06-30 12:48:39 +02:00
2022-02-04 17:28:24 +01:00
[source,vbnet]
2020-06-30 12:48:39 +02:00
----
Public Function GetReadableStatus(job As Job) As String
If job.IsRunning Then Return "Running"
Return If(job.HasErrors, "Failed", "Succeeded")
2020-06-30 12:48:39 +02:00
End Function
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]