Skip to content

Commit 84df4b6

Browse files
Update messages/descriptions with how to fix the alert
1 parent 4346cc6 commit 84df4b6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/codeql/queries/progress-not-cancellable.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
* @kind problem
44
* @problem.severity warning
55
* @id vscode-codeql/progress-not-cancellable
6-
* @description If we call `withProgress` with `cancellable: false` then the
6+
* @description If we call `withProgress` without `cancellable: true` then the
77
* token that is given to us should be ignored because it won't ever be cancelled.
8+
* This makes the code more confusing as it tries to account for cases that can't
9+
* happen. The fix is to either not use the token or make the progress bar cancellable.
810
*/
911

1012
import javascript
1113
import ProgressBar
1214

1315
from ProgressBar t
1416
where not t.isCancellable() and t.usesToken()
15-
select t, "The token should not be used when the progress bar is not cancelable"
17+
select t, "The token should not be used when the progress bar is not cancelable. Either stop using the token or mark the progress bar as cancellable."

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
* @description If we call `withProgress` with `cancellable: true` but then
77
* ignore the token that is given to us, it will lead to a poor user experience
88
* because the progress bar will appear to be canceled but it will not actually
9-
* affect the background process.
9+
* affect the background process. Either check the token and respect when it
10+
* has been cancelled, or mark the progress bar as not cancellable.
1011
*/
1112

1213
import javascript
1314
import ProgressBar
1415

1516
from ProgressBar t
1617
where t.isCancellable() and not t.usesToken()
17-
select t, "This progress bar is $@ but the token is not used", t.getCancellableProperty(), "cancellable"
18+
select t, "This progress bar is $@ but the token is not used. Either use the token or mark the progress bar as not cancellable.", t.getCancellableProperty(), "cancellable"

0 commit comments

Comments
 (0)