github / github/codeql-cli-binaries

Suggestion: `boolean(<formula>)` expression

Offen
#56 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
CLI enhancement
Vorherrschende Sprache
Keine Sprachdaten
Sterne
1k
Forks
184
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

The issue names no files, tests, or implementation entry points. Start by locating the query-expression implementation and existing result-set expression tests, then compare their handling of predicates with the examples in the issue. Done means a boolean() expression evaluates to true or false and is covered by tests.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.