Please see following code examples. In variants Foo1 and Bar1 there is a false positive. Bar1 and Bar2 are nearly the same, but Bar2 does not produce false positive.
Visual BasicPublic Class Class1
Function Foo1(param As String) As Integer
If param Is Nothing Then Return 0
Dim val As String = param
'CRR0027
Return val.Length
End Function
Function Bar1(param As String) As Integer
If param Is Nothing Then Return 0
param &= String.Empty
Dim val As String = param
'CRR0027
Return val.Length
End Function
Function Bar2(param As String) As Integer
If param Is Nothing Then Return 0
param = param & String.Empty
Dim val As String = param
'No CRR0027
Return val.Length
End Function
End Class
Hi Robert,
Thank you for your report. I have reproduced this problem locally. We will fix it in our future builds.