Rudy Regazzoni 42e27b9916
Modify S1774: Migrate to LayC - remove ternary expression (#3288)
## Review

A dedicated reviewer checked the rule description successfully for:

- [ ] logical errors and incorrect information
- [ ] information gaps and missing content
- [ ] text style and tone
- [ ] PR summary and labels follow [the
guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
2023-10-19 10:28:33 +02:00

48 lines
718 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Code examples
==== Noncompliant code example
[source,javascript,diff-id=1,diff-type=noncompliant]
----
function foo(a) {
var b = (a === 'A') ? 'is A' : 'is not A'; // Noncompliant
// ...
}
----
==== Compliant solution
[source,javascript,diff-id=1,diff-type=compliant]
----
function foo(a) {
var b;
if (a === 'A') {
b = 'is A';
}
else {
b = 'is not A';
}
// ...
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]