intermittent false positive for S1871

18 views
Skip to first unread message

Victor Grigoriu

unread,
Oct 26, 2016, 4:42:25 AM10/26/16
to SonarLint
I'm getting an intermittent violation of S1871 for code similar to this:

            if (someFlag)
      {
          return someMethod($"Description_{propertyName}_True");
      }
      else
      {
          return someMethod($"Description_{propertyName}_False");
      }


It seems to only happen on a build machine, and it usually goes away when I retry. Any idea what is going on?

Thanks!

Tamas Vajk

unread,
Oct 26, 2016, 4:50:29 AM10/26/16
to Victor Grigoriu, SonarLint
Hello Victor,

What's the msbuild version on your build machine?
This issue might be related, but it was fixed with VS2015 update 1 https://github.com/dotnet/roslyn/issues/5271

Tamas

Tamas VAJK | SonarSource
Language Team

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/5586f986-8ddf-49a0-ae04-7069e9b4088b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Victor Grigoriu

unread,
Nov 1, 2016, 8:24:47 AM11/1/16
to Tamas Vajk, SonarLint
I installed the latest VS2015 update and I haven't seen this error since then.

On Wed, Oct 26, 2016 at 11:50 AM Tamas Vajk <tamas...@sonarsource.com> wrote:
Hello Victor,

What's the msbuild version on your build machine?
This issue might be related, but it was fixed with VS2015 update 1 https://github.com/dotnet/roslyn/issues/5271

Tamas

Tamas VAJK | SonarSource
Language Team

On 26 October 2016 at 10:42, Victor Grigoriu <vgri...@gmail.com> wrote:
I'm getting an intermittent violation of S1871 for code similar to this:

            if (someFlag)
      {
          return someMethod($"Description_{propertyName}_True");
      }
      else
      {
          return someMethod($"Description_{propertyName}_False");
      }


It seems to only happen on a build machine, and it usually goes away when I retry. Any idea what is going on?

Thanks!

--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages