Link to cancellable property
This commit is contained in:
4
.github/codeql/queries/ProgressBar.qll
vendored
4
.github/codeql/queries/ProgressBar.qll
vendored
@@ -9,8 +9,10 @@ abstract class ProgressBar extends CallExpr {
|
|||||||
|
|
||||||
predicate usesToken() { this.getCallback().getNumParameter() >= 2 }
|
predicate usesToken() { this.getCallback().getNumParameter() >= 2 }
|
||||||
|
|
||||||
|
Property getCancellableProperty() { result = this.getOptions().getPropertyByName("cancellable") }
|
||||||
|
|
||||||
predicate isCancellable() {
|
predicate isCancellable() {
|
||||||
this.getOptions().getPropertyByName("cancellable").getInit().(BooleanLiteral).getBoolValue() =
|
this.getCancellableProperty().getInit().(BooleanLiteral).getBoolValue() =
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
.github/codeql/queries/token-not-used.ql
vendored
2
.github/codeql/queries/token-not-used.ql
vendored
@@ -14,4 +14,4 @@ import ProgressBar
|
|||||||
|
|
||||||
from ProgressBar t
|
from ProgressBar t
|
||||||
where t.isCancellable() and not t.usesToken()
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user