Skip to content

LGTM.com - false positive #3134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jpopadak opened this issue Mar 26, 2020 · 1 comment
Open

LGTM.com - false positive #3134

jpopadak opened this issue Mar 26, 2020 · 1 comment

Comments

@jpopadak
Copy link

Description of the false positive
The code in question is already checking if the value is null or not. I think the algorithm might be getting tripped up on the || of the first if statement highlighted.

URL to the alert on the project page on LGTM.com
https://lgtm.com/projects/g/jpopadak/CoreMatchers/latest/files/src/CoreMatchers/Matchers/IsEqual.cs#x3b4e50392ea9d8ef:1

Code in question
https://github.com/jpopadak/CoreMatchers/blob/master/src/CoreMatchers/Matchers/IsEqual.cs#L70-L91

@hvitved
Copy link
Contributor

hvitved commented Mar 30, 2020

Thanks a lot for reporting this. I agree that it is a false positive, but it is currently too involved for our analysis to handle (indeed, I too had to look closely at the code to see that the value could not be null). For now, I have made sure to record this example in our test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants