Add query for using token when not cancellable

This commit is contained in:
Robert
2024-03-13 16:43:59 +00:00
parent 280bf8b7b2
commit 73bece6f38

View File

@@ -0,0 +1,15 @@
/**
* @name Using token for non-cancellable progress bar
* @kind problem
* @problem.severity warning
* @id vscode-codeql/progress-not-cancellable
* @description If we call `withProgress` with `cancellable: false` then the
* token that is given to us should be ignored because it won't ever be cancelled.
*/
import javascript
import ProgressBar
from ProgressBar t
where not t.isCancellable() and t.usesToken()
select t, "The token should not be used when the progress bar is not cancelable"