Update messages/descriptions with how to fix the alert

This commit is contained in:
Robert 2024-03-13 17:24:09 +00:00
Родитель 4346cc6e98
Коммит 84df4b64d8
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -3,8 +3,10 @@
* @kind problem * @kind problem
* @problem.severity warning * @problem.severity warning
* @id vscode-codeql/progress-not-cancellable * @id vscode-codeql/progress-not-cancellable
* @description If we call `withProgress` with `cancellable: false` then the * @description If we call `withProgress` without `cancellable: true` then the
* token that is given to us should be ignored because it won't ever be cancelled. * token that is given to us should be ignored because it won't ever be cancelled.
* This makes the code more confusing as it tries to account for cases that can't
* happen. The fix is to either not use the token or make the progress bar cancellable.
*/ */
import javascript import javascript
@ -12,4 +14,4 @@ import ProgressBar
from ProgressBar t from ProgressBar t
where not t.isCancellable() and t.usesToken() where not t.isCancellable() and t.usesToken()
select t, "The token should not be used when the progress bar is not cancelable" 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."

5
.github/codeql/queries/token-not-used.ql поставляемый
Просмотреть файл

@ -6,7 +6,8 @@
* @description If we call `withProgress` with `cancellable: true` but then * @description If we call `withProgress` with `cancellable: true` but then
* ignore the token that is given to us, it will lead to a poor user experience * ignore the token that is given to us, it will lead to a poor user experience
* because the progress bar will appear to be canceled but it will not actually * because the progress bar will appear to be canceled but it will not actually
* affect the background process. * affect the background process. Either check the token and respect when it
* has been cancelled, or mark the progress bar as not cancellable.
*/ */
import javascript import javascript
@ -14,4 +15,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 $@ but the token is not used", t.getCancellableProperty(), "cancellable" 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"