28 lines
517 B
Plaintext
Raw Normal View History

2020-06-30 12:48:39 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
function getReadableStatus(job) {
return job.isRunning() ? "Running" : job.hasErrors() ? "Failed" : "Succeeded "; // Noncompliant
2020-06-30 12:48:39 +02:00
}
----
== Compliant Solution
----
function getReadableStatus(job) {
if (job.isRunning()) {
return "Running";
2020-06-30 12:48:39 +02:00
}
return job.hasErrors() ? "Failed" : "Succeeded";
2020-06-30 12:48:39 +02:00
}
----
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::rspecator-view[]