Skip to content

Commit

Permalink
S2629: Add Repro for #9247 (#9248)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim-Pohlmann committed May 6, 2024
1 parent 10f3a36 commit cec9715
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public void BasicScenarios(ILogger logger, int arg)
logger.Log(LogLevel.Warning, "First " + "Second " + "Third"); // Compliant - all strings in the concatenation are constants, the compiler can optimize it
logger.Log(LogLevel.Warning, FieldConstant + localConstant); // Compliant
logger.Log(LogLevel.Warning, FieldConstant + "Second"); // Compliant
logger.Log(LogLevel.Warning, $"Constant: {FieldConstant}"); // Noncompliant FP Repro https://github.com/SonarSource/sonar-dotnet/issues/9247
logger.Log(LogLevel.Warning, "First " + arg + "Third"); // Noncompliant
logger.Log(LogLevel.Warning, ("First " + "Second").ToLower()); // FN

Expand Down

0 comments on commit cec9715

Please sign in to comment.