mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Java: Add entity discard predicates
This commit is contained in:
@@ -6,6 +6,7 @@ module;
|
||||
|
||||
import Expr
|
||||
import metrics.MetricStmt
|
||||
private import semmle.code.java.Overlay
|
||||
|
||||
/** A common super-class of all statements. */
|
||||
class Stmt extends StmtParent, ExprParent, @stmt {
|
||||
@@ -987,3 +988,15 @@ class SuperConstructorInvocationStmt extends Stmt, ConstructorCall, @superconstr
|
||||
|
||||
override string getAPrimaryQlClass() { result = "SuperConstructorInvocationStmt" }
|
||||
}
|
||||
|
||||
overlay[local]
|
||||
private predicate discardableStmt(string file, @stmt s) {
|
||||
not isOverlay() and
|
||||
file = getRawFile(s)
|
||||
}
|
||||
|
||||
/** Discard base statements in files fully extracted in the overlay. */
|
||||
overlay[discard_entity]
|
||||
private predicate discardStmt(@stmt s) {
|
||||
exists(string file | discardableStmt(file, s) and extractedInOverlay(file))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user