Skip to content

Commit

Permalink
Repro for #890
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-epure-sonarsource committed Aug 8, 2019
1 parent f0e079d commit 1bd602e
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -705,4 +705,18 @@ public static IEnumerable<string> LoopWithYeildBreak(IEnumerable<string> list)
}

}

// see https://github.com/SonarSource/sonar-dotnet/issues/890
class TestForLoop
{
string Foo()
{
string s = null;
for (int i = 0; i < 10; i++)
{
s = "";
}
return s.Trim(); // Noncompliant FP due to loop traversal
}
}
}

0 comments on commit 1bd602e

Please sign in to comment.