Skip to content

Commit dbbb9b3

Browse files
committed
Merge branch 'main' into powershell-cfg-for-if-and-match
2 parents f51a486 + e133b5c commit dbbb9b3

File tree

25 files changed

+6668
-59
lines changed

25 files changed

+6668
-59
lines changed

powershell/downgrades/d8eb95bd91979583b569cdd50de46c59210f2aa9/old.dbscheme

Lines changed: 1648 additions & 0 deletions
Large diffs are not rendered by default.

powershell/downgrades/d8eb95bd91979583b569cdd50de46c59210f2aa9/semmlecode.powershell.dbscheme

Lines changed: 1648 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
description: Making column types more specific
2+
compatibility: full
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import semmle.code.powershell.controlflow.internal.ControlFlowGraphImpl::Consistency
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: codeql/powershell-consistency-queries
2+
groups:
3+
- powershell
4+
- microsoft-all
5+
- test
6+
- consistency-queries
7+
dependencies:
8+
microsoft-sdl/powershell-all: ${workspace}
9+
warnOnImplicitThis: true

powershell/ql/lib/qlpack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ groups:
66
dbscheme: semmlecode.powershell.dbscheme
77
extractor: powershell
88
library: true
9+
upgrades: upgrades
910
dependencies:
1011
codeql/controlflow: ${workspace}
1112
warnOnImplicitThis: true

powershell/ql/lib/semmle/code/powershell/Ast.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import powershell
33
class Ast extends @ast {
44
string toString() { none() }
55

6-
Ast getParent() { parent(this, result) } // TODO: Flip parent and child in relation in the extractor
6+
Ast getParent() { parent(this, result) }
77

88
Location getLocation() { none() }
99
}

powershell/ql/lib/semmle/code/powershell/CatchClause.qll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ class CatchClause extends @catch_clause, Ast {
55

66
override string toString() { result = "catch {...}" }
77

8-
StmtBlock getBody() { catch_clause(this, result, _) } // TODO: Change @ast to @stmt_block in dbscheme
8+
StmtBlock getBody() { catch_clause(this, result, _) }
99

10-
TypeConstraint getCatchType(int i) { catch_clause_catch_type(this, i, result) } // TODO: Change @ast to @type_constraint in dbscheme
10+
TypeConstraint getCatchType(int i) { catch_clause_catch_type(this, i, result) }
1111

12-
TypeConstraint getACatchType() { result = this.getCatchType(_) }
12+
int getNumberOfCatchTypes() { result = count(this.getACatchType()) }
1313

14-
int getNumberOfCatchTypes() { result = count(this.getCatchType(_)) }
14+
TypeConstraint getACatchType() { result = this.getCatchType(_) }
1515

16-
predicate isCatchAll() { catch_clause(this, _, true) } // TODO: Should be equivalent to not exists(this.getACatchType())
16+
predicate isCatchAll() { not exists(this.getACatchType()) }
1717

1818
TryStmt getTryStmt() { result.getACatchClause() = this }
1919

powershell/ql/lib/semmle/code/powershell/Configuration.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ class Configuration extends @configuration_definition, Stmt {
55

66
override string toString() { result = "Configuration" }
77

8-
Expr getName() { configuration_definition(this, _, _, result) } // TODO: Change @ast to @expression in dbscheme
8+
Expr getName() { configuration_definition(this, _, _, result) }
99

10-
ScriptBlockExpr getBody() { configuration_definition(this, result, _, _) } // TODO: Change @ast to @script_block in dbscheme
10+
ScriptBlockExpr getBody() { configuration_definition(this, result, _, _) }
1111

1212
predicate isMeta() { configuration_definition(this, _, 1, _) }
1313

powershell/ql/lib/semmle/code/powershell/DataStmt.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ class DataStmt extends @data_statement, Stmt {
1111

1212
Expr getACmdAllowed() { result = this.getCmdAllowed(_) }
1313

14-
StmtBlock getBody() { data_statement(this, result) } // TODO: Change @ast to @stmt_block in dbscheme
14+
StmtBlock getBody() { data_statement(this, result) }
1515
}

0 commit comments

Comments
 (0)