mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Remove LGTM (#16948)
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* @name No floating promises
|
||||
* @kind problem
|
||||
* @problem.severity error
|
||||
* @id js/experimental/floating-promise
|
||||
*/
|
||||
import javascript
|
||||
|
||||
private predicate isEscapingPromise(PromiseDefinition promise) {
|
||||
exists (DataFlow::Node escape | promise.flowsTo(escape) |
|
||||
escape = any(DataFlow::InvokeNode invk).getAnArgument()
|
||||
or
|
||||
escape = any(DataFlow::FunctionNode fun).getAReturn()
|
||||
or
|
||||
escape = any(ThrowStmt t).getExpr().flow()
|
||||
or
|
||||
escape = any(GlobalVariable v).getAnAssignedExpr().flow()
|
||||
or
|
||||
escape = any(DataFlow::PropWrite write).getRhs()
|
||||
or
|
||||
exists(WithStmt with, Assignment assign |
|
||||
with.mayAffect(assign.getLhs()) and
|
||||
assign.getRhs().flow() = escape
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
from PromiseDefinition promise
|
||||
where
|
||||
not exists(promise.getAMethodCall(any(string m | m = "then" or m = "catch" or m = "finally"))) and
|
||||
not exists (AwaitExpr e | promise.flowsTo(e.getOperand().flow())) and
|
||||
not isEscapingPromise(promise)
|
||||
select promise, "This promise appears to be a floating promise"
|
||||
@@ -57,7 +57,7 @@ export class AzCliTool extends ToolBase {
|
||||
|
||||
protected getVersionFromOutput(output: string): SemVer | undefined {
|
||||
if (output && output.includes('azure-cli')) {
|
||||
return new SemVer(output.split(EOL)[0].replace('azure-cli', '').replace(/ /g, '').replace('*', '')); //lgtm [js/incomplete-sanitization]
|
||||
return new SemVer(output.split(EOL)[0].replace('azure-cli', '').replace(/ /g, '').replace('*', ''));
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user