@@ -31,11 +31,22 @@ private string containerAsJar(Container container) {
31
31
if container instanceof JarFile then result = container .getBaseName ( ) else result = "rt.jar"
32
32
}
33
33
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
+
34
45
/**
35
46
* An external API from either the Standard Library or a 3rd party library.
36
47
*/
37
48
class ExternalApi extends Callable {
38
- ExternalApi ( ) { not this .fromSource ( ) }
49
+ ExternalApi ( ) { not this .fromSource ( ) and not isUninteresting ( this ) }
39
50
40
51
/**
41
52
* Gets information about the external API in the form expected by the CSV modeling framework.
@@ -73,18 +84,6 @@ class ExternalApi extends Callable {
73
84
TaintTracking:: localAdditionalTaintStep ( this .getAnInput ( ) , _)
74
85
}
75
86
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. */
88
87
predicate isSource ( ) {
89
88
this .getAnOutput ( ) instanceof RemoteFlowSource or sourceNode ( this .getAnOutput ( ) , _)
90
89
}
0 commit comments