
Co-authored-by: Amélie Renard <44666826+amelie-renard-sonarsource@users.noreply.github.com>
27 lines
612 B
Plaintext
27 lines
612 B
Plaintext
[source,csharp]
|
|
----
|
|
if (condition)
|
|
FirstActionInBlock();
|
|
SecondAction(); // Noncompliant: SecondAction is executed unconditionally
|
|
ThirdAction();
|
|
----
|
|
|
|
[source,csharp]
|
|
----
|
|
if(condition) FirstActionInBlock(); SecondAction(); // Noncompliant: SecondAction is executed unconditionally
|
|
----
|
|
|
|
[source,csharp]
|
|
----
|
|
if (condition) FirstActionInBlock();
|
|
SecondAction(); // Noncompliant: SecondAction is executed unconditionally
|
|
----
|
|
|
|
[source,csharp]
|
|
----
|
|
string str = null;
|
|
for (int i = 0; i < array.Length; i++)
|
|
str = array[i];
|
|
DoTheThing(str); // Noncompliant: executed only on the last element
|
|
----
|