rspec/rules/S3358/csharp/rule.adoc

45 lines
731 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
[source,csharp]
----
public string GetReadableStatus(Job j)
{
return j.IsRunning ? "Running" : j.HasErrors ? "Failed" : "Succeeded"; // Noncompliant
}
----
=== Compliant solution
[source,csharp]
----
public string GetReadableStatus(Job j)
{
if (j.IsRunning)
{
return "Running";
}
return j.HasErrors ? "Failed" : "Succeeded";
}
----
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[]