Skip to content

Commit e133b5c

Browse files
authored
Merge pull request #88 from microsoft/more-specific-dbscheme-column-types
PS: Small dbscheme updates
2 parents 5e4f52a + 3f98f37 commit e133b5c

File tree

22 files changed

+6656
-57
lines changed

22 files changed

+6656
-57
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

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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +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) }
11+
12+
int getNumberOfCatchTypes() { result = count(this.getACatchType()) }
1113

1214
TypeConstraint getACatchType() { result = this.getCatchType(_) }
1315

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

1618
TryStmt getTryStmt() { result.getACatchClause() = this }
1719
}

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
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class DoUntilStmt extends @do_until_statement, LoopStmt {
55

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

8-
PipelineBase getCondition() { do_until_statement_condition(this, result) } // TODO: Change @ast to @pipeline_base in dbscheme
8+
PipelineBase getCondition() { do_until_statement_condition(this, result) }
99

10-
final override StmtBlock getBody() { do_until_statement(this, result) } // TODO: Change @ast to @stmt_block in dbscheme
10+
final override StmtBlock getBody() { do_until_statement(this, result) }
1111
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class DoWhileStmt extends @do_while_statement, LoopStmt {
55

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

8-
PipelineBase getCondition() { do_while_statement_condition(this, result) } // TODO: Change @ast to @pipeline_base in dbscheme
8+
PipelineBase getCondition() { do_while_statement_condition(this, result) }
99

10-
final override StmtBlock getBody() { do_while_statement(this, result) } // TODO: Change @ast to @stmt_block in dbscheme
10+
final override StmtBlock getBody() { do_while_statement(this, result) }
1111
}

0 commit comments

Comments
 (0)