mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Exclude test directories of typical build tools
This commit is contained in:
@@ -42,7 +42,8 @@ class ServletMainMethod extends Method {
|
||||
this.getNumberOfParameters() = 1 and
|
||||
this.getParameter(0).getType() instanceof Array and
|
||||
not this.getDeclaringType().getName().toLowerCase().matches("%test%") and // Simple check to exclude test classes to reduce FPs
|
||||
not this.getDeclaringType().getPackage().getName().toLowerCase().matches("%test%") // Simple check to exclude classes in test packages to reduce FPs
|
||||
not this.getDeclaringType().getPackage().getName().toLowerCase().matches("%test%") and // Simple check to exclude classes in test packages to reduce FPs
|
||||
not exists(this.getLocation().getFile().getAbsolutePath().indexOf("/src/test/java")) // Match test directory structure of build tools like maven
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user