2020-06-30 12:48:39 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
2020-12-21 15:38:52 +01:00
|
|
|
function getReadableStatus(job) {
|
|
|
|
return job.isRunning() ? "Running" : job.hasErrors() ? "Failed" : "Succeeded "; // Noncompliant
|
2020-06-30 12:48:39 +02:00
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
2020-12-21 15:38:52 +01:00
|
|
|
function getReadableStatus(job) {
|
|
|
|
if (job.isRunning()) {
|
|
|
|
return "Running";
|
2020-06-30 12:48:39 +02:00
|
|
|
}
|
2020-12-21 15:38:52 +01:00
|
|
|
return job.hasErrors() ? "Failed" : "Succeeded";
|
2020-06-30 12:48:39 +02:00
|
|
|
}
|
|
|
|
----
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|