
Co-authored-by: Amélie Renard <44666826+amelie-renard-sonarsource@users.noreply.github.com>
20 lines
297 B
Plaintext
20 lines
297 B
Plaintext
[source,swift]
|
|
----
|
|
if b == 0 { // Noncompliant
|
|
doOneMoreThing()
|
|
} else {
|
|
doOneMoreThing()
|
|
}
|
|
|
|
var b = a > 12 ? 4 : 4 // Noncompliant; always results in the same value
|
|
|
|
switch i { // Noncompliant
|
|
case 1:
|
|
doSomething()
|
|
case 2:
|
|
doSomething()
|
|
default:
|
|
doSomething()
|
|
}
|
|
----
|