codeql icon indicating copy to clipboard operation
codeql copied to clipboard

LGTM.com - false positive - unused static function

Open edgchen1 opened this issue 3 years ago • 1 comments
trafficstars

Description of the false positive

The alert is "Static function IsTypeProtoCompatible is unreachable". Help for that alert indicates that it is about an unused static function.

However, that function is actually used later in the file: https://lgtm.com/projects/g/microsoft/onnxruntime/snapshot/b7c967a8110811599816346da0294ee681c6cb74/files/onnxruntime/core/framework/kernel_registry.cc?sort=name&dir=ASC&mode=heatmap#L85

URL to the alert on the project page on LGTM.com

https://lgtm.com/projects/g/microsoft/onnxruntime/snapshot/b7c967a8110811599816346da0294ee681c6cb74/files/onnxruntime/core/framework/kernel_registry.cc?sort=name&dir=ASC&mode=heatmap#x35f8eff849669b65:1

edgchen1 avatar Sep 15 '22 18:09 edgchen1

Hi @edgchen1,

Thanks for raising this issue!

False positives in this query usually occur because we don't properly extract the function containing the call to the static function (and thus we claim it's "unreachable").

I've created an internal ticket for this issue. I'll be sure to update you once we fix this.

In the meantime, you can use an alert-suppression comment to disable the alert on the function.

MathiasVP avatar Sep 16 '22 08:09 MathiasVP