github / github/codeql-cli-binaries

Suggestion: `boolean(<formula>)` expression

未关闭
#56 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
CLI enhancement
主要语言
没有语言数据
星标
1k
派生
184
PR 合并指标
30 天内没有已合并 PR

描述

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())
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。