mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C#: Address review comments
This commit is contained in:
@@ -9,7 +9,7 @@ abstract class AssertMethod extends Method {
|
||||
abstract int getAssertionIndex();
|
||||
|
||||
/** Gets the parameter being asserted. */
|
||||
final Parameter getAssertionParameter() {
|
||||
final Parameter getAssertedParameter() {
|
||||
result = this.getParameter(this.getAssertionIndex())
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class Assertion extends MethodCall {
|
||||
|
||||
/** Gets the expression that this assertion pertains to. */
|
||||
Expr getExpr() {
|
||||
result = this.getArgumentForParameter(target.getAssertionParameter())
|
||||
result = this.getArgumentForParameter(target.getAssertedParameter())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ class FailingAssertion extends Assertion {
|
||||
am = this.getAssertMethod() and
|
||||
e = this.getExpr() |
|
||||
am instanceof AssertTrueMethod and
|
||||
e.(BoolLiteral).getBoolValue() = false
|
||||
e.getValue() = "false"
|
||||
or
|
||||
am instanceof AssertFalseMethod and
|
||||
e.(BoolLiteral).getBoolValue() = true
|
||||
e.getValue() = "true"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
import csharp
|
||||
|
||||
class Stub extends File {
|
||||
Stub() {
|
||||
class StubFile extends File {
|
||||
StubFile() {
|
||||
this.getAbsolutePath().matches("%resources/stubs/%")
|
||||
}
|
||||
}
|
||||
|
||||
class SourceControlFlowElement extends ControlFlowElement {
|
||||
SourceControlFlowElement() {
|
||||
not this.getLocation().getFile() instanceof Stub
|
||||
not this.getLocation().getFile() instanceof StubFile
|
||||
}
|
||||
}
|
||||
|
||||
class SourceControlFlowNode extends ControlFlow::Node {
|
||||
SourceControlFlowNode() {
|
||||
not this.getLocation().getFile() instanceof Stub
|
||||
not this.getLocation().getFile() instanceof StubFile
|
||||
}
|
||||
}
|
||||
|
||||
class SourceBasicBlock extends ControlFlow::BasicBlock {
|
||||
SourceBasicBlock() {
|
||||
not this.getLocation().getFile() instanceof Stub
|
||||
not this.getLocation().getFile() instanceof StubFile
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user