@@ -31,11 +31,22 @@ private string containerAsJar(Container container) {
3131 if container instanceof JarFile then result = container .getBaseName ( ) else result = "rt.jar"
3232}
3333
34+ /** Holds if the given callable is a constructor without parameters. */
35+ private predicate isParameterlessConstructor ( Callable c ) {
36+ c instanceof Constructor and c .getNumberOfParameters ( ) = 0
37+ }
38+
39+ /** Holds if the given callable is part of a common testing library or framework. */
40+ private predicate isTestLibrary ( Callable c ) { c .getDeclaringType ( ) instanceof TestLibrary }
41+
42+ /** Holds if the given callable is not worth supporting. */
43+ private predicate isUninteresting ( Callable c ) { isTestLibrary ( c ) or isParameterlessConstructor ( c ) }
44+
3445/**
3546 * An external API from either the Standard Library or a 3rd party library.
3647 */
3748class ExternalApi extends Callable {
38- ExternalApi ( ) { not this .fromSource ( ) }
49+ ExternalApi ( ) { not this .fromSource ( ) and not isUninteresting ( this ) }
3950
4051 /**
4152 * Gets information about the external API in the form expected by the CSV modeling framework.
@@ -73,18 +84,6 @@ class ExternalApi extends Callable {
7384 TaintTracking:: localAdditionalTaintStep ( this .getAnInput ( ) , _)
7485 }
7586
76- /** Holds if this API is a constructor without parameters. */
77- private predicate isParameterlessConstructor ( ) {
78- this instanceof Constructor and this .getNumberOfParameters ( ) = 0
79- }
80-
81- /** Holds if this API is part of a common testing library or framework. */
82- private predicate isTestLibrary ( ) { this .getDeclaringType ( ) instanceof TestLibrary }
83-
84- /** Holds if this API is not worth supporting. */
85- predicate isUninteresting ( ) { this .isTestLibrary ( ) or this .isParameterlessConstructor ( ) }
86-
87- /** Holds if this API is a known source. */
8887 predicate isSource ( ) {
8988 this .getAnOutput ( ) instanceof RemoteFlowSource or sourceNode ( this .getAnOutput ( ) , _)
9089 }
0 commit comments