SonarQube not working with coalesce operators (ex: ??)

Viewed 72

This codeblock is tagged in SonarQube rule "Conditionally executed blocks should be reachable"

// myObject is an instance of a class and IsActive is a boolean property
if (myObject?.IsActive ?? false) {...

Which, in my case, is functionally the same as:

if (myObject != null && myObject.IsActive)

Why is this being tagged by the SonarQube rule?

0 Answers
Related