github / github/codeql

LGTM.com - false positive C# nullable types/linq Where then Select

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

説明

**Description of the false positive**

An earlier lamda uses `Where` with nullable Type (int?) `HasValue`. Later lamda dereferences `ID.Value`. It is a false positive because the first lamda ensures there are no null values.

```csharp
// the cohorts in the database
var available = ExtractableCohort.GetImportableCohortDefinitions(ect).Where(c=>c.ID.HasValue).ToArray();

[...]

// new ones we don't know about yet
available = available.Where(c => !existing.Contains(c.ID.Value)).ToArray();
```

https://lgtm.com/projects/g/HicServices/RDMP/rev/pr-51dd5b87e2dee7ed707f8a2b4855b01ad10e3ca0

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

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

評価

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

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

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