False positive: Dereferenced variable may be null ignore NRT attributes
- 主要语言
- CodeQL
- 星标
- 10.1k
- 派生
- 2.1k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 141
描述
**Description of the false positive**
NRT attributes appear to be ignored by CodeQL. This results in lots of noise as we have to explicitly mark each point of use as a false positive and so safe.
**Code samples or links to source code**
```cs
if (TryConvertContractState(tradingPhase, state, out Models.ContractState? contractState))
return contractState.Value;
```
when it is defined as:
```cs
private static bool TryConvertContractState(
string tradingPhase, string state,
[NotNullWhen(true)] out PersistedModels.ContractState? cdmState)
{}
```
**URL to the alert on GitHub code scanning (optional)**
Private Repo, but the view query source goes to: https://github.com/github/codeql/blob/aa3000df1310b332ba1c84afec3bacb0aeb4dbbd/csharp/ql/src/CSI/NullMaybe.ql
贡献指南
评估
这个 Issue 还没有评估数据。