diff --git a/.github/codeql/queries/ProgressBar.qll b/.github/codeql/queries/ProgressBar.qll index 601dca3d4..042f15208 100644 --- a/.github/codeql/queries/ProgressBar.qll +++ b/.github/codeql/queries/ProgressBar.qll @@ -9,8 +9,10 @@ abstract class ProgressBar extends CallExpr { predicate usesToken() { this.getCallback().getNumParameter() >= 2 } + Property getCancellableProperty() { result = this.getOptions().getPropertyByName("cancellable") } + predicate isCancellable() { - this.getOptions().getPropertyByName("cancellable").getInit().(BooleanLiteral).getBoolValue() = + this.getCancellableProperty().getInit().(BooleanLiteral).getBoolValue() = true } } diff --git a/.github/codeql/queries/token-not-used.ql b/.github/codeql/queries/token-not-used.ql index 5a01d5f92..75de92998 100644 --- a/.github/codeql/queries/token-not-used.ql +++ b/.github/codeql/queries/token-not-used.ql @@ -14,4 +14,4 @@ import ProgressBar from ProgressBar t where t.isCancellable() and not t.usesToken() -select t, "This progress bar is cancelable but the token is not used" +select t, "This progress bar is $@ but the token is not used", t.getCancellableProperty(), "cancellable"