Link to cancellable property

This commit is contained in:
Robert
2024-03-13 17:08:55 +00:00
parent 73bece6f38
commit 4346cc6e98
2 changed files with 4 additions and 2 deletions

View File

@@ -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
} }
} }

View File

@@ -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"