Skip to content

Commit 4346cc6

Browse files
Link to cancellable property
1 parent 73bece6 commit 4346cc6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/codeql/queries/ProgressBar.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ abstract class ProgressBar extends CallExpr {
99

1010
predicate usesToken() { this.getCallback().getNumParameter() >= 2 }
1111

12+
Property getCancellableProperty() { result = this.getOptions().getPropertyByName("cancellable") }
13+
1214
predicate isCancellable() {
13-
this.getOptions().getPropertyByName("cancellable").getInit().(BooleanLiteral).getBoolValue() =
15+
this.getCancellableProperty().getInit().(BooleanLiteral).getBoolValue() =
1416
true
1517
}
1618
}

.github/codeql/queries/token-not-used.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ import ProgressBar
1414

1515
from ProgressBar t
1616
where t.isCancellable() and not t.usesToken()
17-
select t, "This progress bar is cancelable but the token is not used"
17+
select t, "This progress bar is $@ but the token is not used", t.getCancellableProperty(), "cancellable"

0 commit comments

Comments
 (0)