File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
java/ql/src/experimental/Security/CWE/CWE-489 Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ class ServletMainMethod extends Method {
4242 this .getNumberOfParameters ( ) = 1 and
4343 this .getParameter ( 0 ) .getType ( ) instanceof Array and
4444 not this .getDeclaringType ( ) .getName ( ) .toLowerCase ( ) .matches ( "%test%" ) and // Simple check to exclude test classes to reduce FPs
45- not this .getDeclaringType ( ) .getPackage ( ) .getName ( ) .toLowerCase ( ) .matches ( "%test%" ) // Simple check to exclude classes in test packages to reduce FPs
45+ not this .getDeclaringType ( ) .getPackage ( ) .getName ( ) .toLowerCase ( ) .matches ( "%test%" ) and // Simple check to exclude classes in test packages to reduce FPs
46+ not exists ( this .getLocation ( ) .getFile ( ) .getAbsolutePath ( ) .indexOf ( "/src/test/java" ) ) // Match test directory structure of build tools like maven
4647 }
4748}
4849
You can’t perform that action at this time.
0 commit comments