зеркало из https://github.com/github/codeql.git
Merge pull request #14581 from jcogs33/jcogs33/add-internal-to-model-exclusions
Java: exclude internal packages globally from MaD models
This commit is contained in:
Коммит
53d92d58fc
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче