Please provide
- Operating system: Windows 10
- Visual Studio version: 17.9.6
- SonarLint plugin version: Nuget SonarAnalyzers.CSharp 9.32.0.97167
- Programming language you’re coding in: C#
- Is connected mode used: No
- Connected to SonarCloud or SonarQube (and which version):
And a thorough description of the problem / question:
Snippet
S2583
bool isDebug = false;
#if DEBUG
isDebug = true;
#endif
if(isDebug)
{
}
This will trigger:
Warning S2583 Change this condition so that it does not always evaluate to ‘True’. Some code paths are unreachable.
And it shouldn’t be triggered, because debug is changing depending on a preprocessor directive.