rspec/rules/S1774/java/rule.adoc
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

40 lines
578 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Code examples
==== Noncompliant code example
[source,java]
----
System.out.println(i>10?"yes":"no"); // Noncompliant
----
==== Compliant solution
[source,java]
----
if (i > 10) {
System.out.println("yes");
} else {
System.out.println("no");
}
----
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[]