Skip to content

Commit

Permalink
Add repro for #2555 (#2771)
Browse files Browse the repository at this point in the history
  • Loading branch information
costin-zaharia-sonarsource authored and andrei-epure-sonarsource committed Nov 6, 2019
1 parent 693b21f commit 564eeb5
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,19 @@ public string foo(string x)
{
if (x == null)
{
x = ""; // Noncompliant FP
x = ""; // Noncompliant FP (https://github.com/SonarSource/sonar-dotnet/issues/2603)
}
return x;
}

public string Foo(string text)
{
if (string.IsNullOrWhiteSpace(text))
{
text = "(empty)"; // Noncompliant FP (https://github.com/SonarSource/sonar-dotnet/issues/2555)
}

return text;
}
}

Expand Down

0 comments on commit 564eeb5

Please sign in to comment.