@@ -8,23 +8,25 @@ private import semmle.code.java.dataflow.FlowSummary
88private import semmle.code.java.dataflow.internal.DataFlowPrivate
99private import semmle.code.java.dataflow.TaintTracking
1010
11+ pragma [ nomagic]
12+ private predicate isTestPackage ( Package p ) {
13+ p .getName ( )
14+ .matches ( [
15+ "org.junit%" , "junit.%" , "org.mockito%" , "org.assertj%" ,
16+ "com.github.tomakehurst.wiremock%" , "org.hamcrest%" , "org.springframework.test.%" ,
17+ "org.springframework.mock.%" , "org.springframework.boot.test.%" , "reactor.test%" ,
18+ "org.xmlunit%" , "org.testcontainers.%" , "org.opentest4j%" , "org.mockserver%" ,
19+ "org.powermock%" , "org.skyscreamer.jsonassert%" , "org.rnorth.visibleassertions" ,
20+ "org.openqa.selenium%" , "com.gargoylesoftware.htmlunit%" , "org.jboss.arquillian.testng%" ,
21+ "org.testng%"
22+ ] )
23+ }
24+
1125/**
1226 * A test library.
1327 */
1428private class TestLibrary extends RefType {
15- TestLibrary ( ) {
16- this .getPackage ( )
17- .getName ( )
18- .matches ( [
19- "org.junit%" , "junit.%" , "org.mockito%" , "org.assertj%" ,
20- "com.github.tomakehurst.wiremock%" , "org.hamcrest%" , "org.springframework.test.%" ,
21- "org.springframework.mock.%" , "org.springframework.boot.test.%" , "reactor.test%" ,
22- "org.xmlunit%" , "org.testcontainers.%" , "org.opentest4j%" , "org.mockserver%" ,
23- "org.powermock%" , "org.skyscreamer.jsonassert%" , "org.rnorth.visibleassertions" ,
24- "org.openqa.selenium%" , "com.gargoylesoftware.htmlunit%" ,
25- "org.jboss.arquillian.testng%" , "org.testng%"
26- ] )
27- }
29+ TestLibrary ( ) { isTestPackage ( this .getPackage ( ) ) }
2830}
2931
3032private string containerAsJar ( Container container ) {
@@ -74,16 +76,19 @@ class ExternalApi extends Callable {
7476 }
7577
7678 /** Holds if this API has a supported summary. */
79+ pragma [ nomagic]
7780 predicate hasSummary ( ) {
7881 this = any ( SummarizedCallable sc ) .asCallable ( ) or
7982 TaintTracking:: localAdditionalTaintStep ( this .getAnInput ( ) , _)
8083 }
8184
85+ pragma [ nomagic]
8286 predicate isSource ( ) {
8387 this .getAnOutput ( ) instanceof RemoteFlowSource or sourceNode ( this .getAnOutput ( ) , _)
8488 }
8589
8690 /** Holds if this API is a known sink. */
91+ pragma [ nomagic]
8792 predicate isSink ( ) { sinkNode ( this .getAnInput ( ) , _) }
8893
8994 /** Holds if this API is supported by existing CodeQL libraries, that is, it is either a recognized source or sink or has a flow summary. */
0 commit comments