github / github/codeql-cli-binaries
Suggestion: `boolean(<formula>)` expression
Đang mở
CLI
enhancement
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 1k
- Fork
- 184
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Especially when debugging queries it can often be interesting to know whether a predicate (or a relation) holds or not. However, you can only use expressions in result sets, requiring you to manually get a `boolean` value for the predicate in question, e.g.:
```ql
import java
from Method m, boolean isStatic
where
if m.isStatic() then isStatic = true
else isStatic = false
select m, isStatic
```
Therefore it might be useful to introduce a `boolean()` expression. If the formula holds, then the result is `true`, otherwise `false`:
```ql
import java
from Method m
select m, boolean(m.isStatic())
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.