Skip to content

Commit 2d8a8c0

Browse files
committed
PS: Shorter predicate names for statement blocks.
1 parent 7ad60ca commit 2d8a8c0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ class ForEachStmt extends @foreach_statement, LoopStmt {
99

1010
VarAccess getVariable() { foreach_statement(this, result, _, _, _) } // TODO: Change @ast to @variable_expression in dbscheme
1111

12-
/** ..., if any. */
13-
PipelineBase getCondition() { foreach_statement(this, _, result, _, _) } // TODO: Change @ast to @pipeline_base in dbscheme
12+
PipelineBase getIterableExpr() { foreach_statement(this, _, result, _, _) } // TODO: Change @ast to @pipeline_base in dbscheme
1413

1514
predicate isParallel() { foreach_statement(this, _, _, _, 1) }
1615
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ import powershell
33
class StmtBlock extends @statement_block, Ast {
44
override SourceLocation getLocation() { statement_block_location(this, result) }
55

6-
int getNumStatements() { statement_block(this, result, _) }
6+
int getNumberOfStmts() { statement_block(this, result, _) }
77

88
int getNumTraps() { statement_block(this, _, result) }
99

10-
Stmt getStatement(int index) { statement_block_statement(this, index, result) }
10+
Stmt getStmt(int index) { statement_block_statement(this, index, result) }
1111

12-
Stmt getAStatement() { result = this.getStatement(_) }
12+
Stmt getAStmt() { result = this.getStmt(_) }
1313

14-
TrapStmt getTrapStatement(int index) { statement_block_trap(this, index, result) }
14+
TrapStmt getTrapStmt(int index) { statement_block_trap(this, index, result) }
1515

16-
TrapStmt getATrapStatement() { result = this.getTrapStatement(_) }
16+
TrapStmt getATrapStmt() { result = this.getTrapStmt(_) }
1717

1818
override string toString() { result = "{...}" }
1919
}

0 commit comments

Comments
 (0)