Java: exclude internal packages in general from models

This commit is contained in:
Jami Cogswell
2023-10-24 12:49:49 -04:00
parent 06b1cd939c
commit 121fd0896b

View File

@@ -53,10 +53,16 @@ private predicate isJdkInternal(CompilationUnit cu) {
cu.getPackage().getName() = ""
}
/** Holds if the given compilation unit's package is internal. */
private predicate isInternal(CompilationUnit cu) {
isJdkInternal(cu) or
cu.getPackage().getName().matches("%internal%")
}
/** Holds if the given callable is not worth modeling. */
predicate isUninterestingForModels(Callable c) {
isInTestFile(c.getCompilationUnit().getFile()) or
isJdkInternal(c.getCompilationUnit()) or
isInternal(c.getCompilationUnit()) or
c instanceof MainMethod or
c instanceof StaticInitializer or
exists(FunctionalExpr funcExpr | c = funcExpr.asMethod()) or