@@ -31,11 +31,17 @@ 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 not worth supporting. */
35+ private predicate isUninteresting ( Callable c ) {
36+ c .getDeclaringType ( ) instanceof TestLibrary or
37+ c .( Constructor ) .isParameterless ( )
38+ }
39+
3440/**
3541 * An external API from either the Standard Library or a 3rd party library.
3642 */
3743class ExternalApi extends Callable {
38- ExternalApi ( ) { not this .fromSource ( ) }
44+ ExternalApi ( ) { not this .fromSource ( ) and not isUninteresting ( this ) }
3945
4046 /**
4147 * Gets information about the external API in the form expected by the CSV modeling framework.
@@ -73,18 +79,6 @@ class ExternalApi extends Callable {
7379 TaintTracking:: localAdditionalTaintStep ( this .getAnInput ( ) , _)
7480 }
7581
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. */
8882 predicate isSource ( ) {
8983 this .getAnOutput ( ) instanceof RemoteFlowSource or sourceNode ( this .getAnOutput ( ) , _)
9084 }
0 commit comments