github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.48k stars 1.49k forks source link

LGTM.com - false positive #4907

Open sungam3r opened 3 years ago

sungam3r commented 3 years ago

https://lgtm.com/projects/g/graphql-dotnet/graphql-dotnet/snapshot/71e3fc454901355ca93f115b0004d510b683b056/files/src/GraphQL/Execution/ExecutionHelper.cs?sort=name&dir=ASC&mode=heatmap#x9cfe0b597cc40b2b:1

Both IObjectGraphType and IInputObjectGraphType inherit from IComplexGraphType so complexType variable is always not null.

hvitved commented 3 years ago

In that case I suggest you change type as IComplexGraphType to (IComplexGraphType)type, which will makes the intent clear (and gets rid of the alert).

sungam3r commented 3 years ago

OK but it's still false positive.