Hello there. I’m using SonarQube Developer Edition Version 8.3.1 (build 34397) testing C# solution and I get Code Smells on lines of code that compare two string-typed objects (class property and string constant on a static class) using pattern matching of is
operator:
bool result = myObject.StringProperty is Const.Example;
instead of:
bool result = myObject.StringProperty == Const.Example;
No type-check is necessary because both types are known to be the same during compile time, but the rule still complains with “Use a ‘null’ check instead.”