mirror of
https://github.com/github/codeql.git
synced 2026-02-20 08:53:49 +01:00
CFG: hide nodes that are not proper AstNodes
This commit is contained in:
@@ -14,26 +14,4 @@ module AstNode {
|
||||
|
||||
predicate child(string label, AstNode::Range child) { none() }
|
||||
}
|
||||
|
||||
// TODO: Remove
|
||||
private class RemoveWhenFullCoverage extends Range {
|
||||
// Lists the entities that are currently used in tests but do not yet
|
||||
// have an external ASTNode. Perhaps not all entities below need to be
|
||||
// an AST node, for example we include the `in` keyword in `for` loops
|
||||
// in the CFG, but not the AST
|
||||
RemoveWhenFullCoverage() {
|
||||
this = any(Generated::Method m).getName()
|
||||
or
|
||||
this = any(Generated::SingletonMethod m).getName()
|
||||
or
|
||||
this = any(Generated::Call c).getMethod() and
|
||||
not this instanceof Generated::ScopeResolution
|
||||
or
|
||||
this instanceof Generated::RestAssignment
|
||||
or
|
||||
this instanceof Generated::Superclass
|
||||
}
|
||||
|
||||
override string toString() { result = "AstNode" }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +203,20 @@ private predicate succImpl(AstNode pred, AstNode succ, Completion c) {
|
||||
any(ControlFlowTree cft).succ(pred, succ, c)
|
||||
}
|
||||
|
||||
private predicate isHidden(ControlFlowTree t) { t.isHidden() }
|
||||
private predicate isHidden(ControlFlowTree t) {
|
||||
t.isHidden()
|
||||
or
|
||||
t = any(Method m).getName()
|
||||
or
|
||||
t = any(SingletonMethod m).getName()
|
||||
or
|
||||
t = any(Call c).getMethod() and
|
||||
not t instanceof ScopeResolution
|
||||
or
|
||||
t instanceof RestAssignment
|
||||
or
|
||||
t instanceof Superclass
|
||||
}
|
||||
|
||||
private predicate succImplIfHidden(AstNode pred, AstNode succ) {
|
||||
isHidden(pred) and
|
||||
|
||||
Reference in New Issue
Block a user