mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
23 lines
696 B
Plaintext
23 lines
696 B
Plaintext
import csharp
|
|
|
|
/**
|
|
* A method call where the target is unknown.
|
|
* The purpose of this is to ensure that all MethodCall expressions
|
|
* have a valid `toString()`.
|
|
*/
|
|
class UnknownCall extends Call {
|
|
UnknownCall() { not exists(this.getTarget()) }
|
|
|
|
override string toString() { result = "Call (unknown target)" }
|
|
}
|
|
|
|
class UnknownLocalVariableDeclExpr extends LocalVariableDeclAndInitExpr {
|
|
UnknownLocalVariableDeclExpr() { not exists(this.getVariable().getType().getName()) }
|
|
|
|
override string toString() { result = "(unknown type) " + this.getName() }
|
|
}
|
|
|
|
query predicate edges(ControlFlow::Node n1, ControlFlow::Node n2) {
|
|
not n1.getElement().fromLibrary() and n2 = n1.getASuccessor()
|
|
}
|