github / github/codeql

cs/unused-collection false positive?

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

説明

Hope this is the right place to file analyzer issues as well, didn't really see any info on recommendations for reporting issues anywhere.

We saw a "Container contents are never accessed" error on our report `cs/unused-collection`: https://github.com/CommunityToolkit/Windows/security/code-scanning/9

Flagging this code in our file:

```cs
private List _overflow = new List();
```

But it was used here in our ArrangeOverride method:

```cs
///
protected override Size ArrangeOverride(Size finalSize)
{
// Have grid to the bulk of our heavy lifting.
var size = base.ArrangeOverride(finalSize);

// Make sure all overflown elements have no size.
foreach (var child in _overflow)
{
child.Arrange(default);
}
```

Is this due to the `foreach` usage or because this is in a framework/platform method that is uncalled by our codebase directly but will be called by the XAML/UWP/WindowsAppSDK platform?

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

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

評価

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

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

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