github / github/codeql

LGTM.com - false positive - cs/unused-collection when usage is within methods that caller overrides within an abstract class

オープン
#2,776 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
C# false-positive
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

**Description of the false positive**

The `cs/unused-collection` is resulting in some false positives: https://lgtm.com/rules/1506094606044/

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

https://lgtm.com/projects/g/dotnet/corefx/snapshot/4fed824926d1c659c494bd5261fbae0236b2e9da/files/src/System.Linq.Expressions/src/System/Runtime/CompilerServices/CallSiteBinder.cs?sort=name&dir=ASC&mode=heatmap#x343810f1b8fd4a23:1

In this particular case, the collection is initialized here and then passed to an abstract method (so the caller could have needed/accessed the elements):
Initialized: https://source.dot.net/#System.Linq.Expressions/System/Runtime/CompilerServices/CallSiteBinder.cs,7785087df39cf34b
Passed to an abstract method: https://source.dot.net/#System.Linq.Expressions/System/Runtime/CompilerServices/CallSiteBinder.cs,129
User defined method that overrides it accesses the collection elements: https://source.dot.net/#System.Linq.Expressions/System/Runtime/CompilerServices/CallSiteBinder.cs,9c8a7458b545d05d

For example, see:
https://source.dot.net/#System.Linq.Expressions/System/Dynamic/DynamicMetaObjectBinder.cs,49

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。