@@ -24,14 +24,26 @@ class TestLibrary extends RefType {
24
24
}
25
25
}
26
26
27
+ /** Holds if the given callable is a constructor without parameters. */
28
+ private predicate isParameterlessConstructor ( DotNet:: Callable c ) {
29
+ c instanceof Constructor and c .getNumberOfParameters ( ) = 0
30
+ }
31
+
32
+ /** Holds if this API is part of a common testing library or framework. */
33
+ private predicate isTestLibrary ( DotNet:: Callable c ) { c .getDeclaringType ( ) instanceof TestLibrary }
34
+
35
+ /** Holds if this API is not worth supporting. */
36
+ predicate isUninteresting ( DotNet:: Callable c ) { isTestLibrary ( c ) or isParameterlessConstructor ( c ) }
37
+
27
38
/**
28
39
* An external API from either the C# Standard Library or a 3rd party library.
29
40
*/
30
41
class ExternalApi extends DotNet:: Callable {
31
42
ExternalApi ( ) {
32
43
this .isUnboundDeclaration ( ) and
33
44
this .fromLibrary ( ) and
34
- this .( Modifiable ) .isEffectivelyPublic ( )
45
+ this .( Modifiable ) .isEffectivelyPublic ( ) and
46
+ not isUninteresting ( this )
35
47
}
36
48
37
49
/**
@@ -84,17 +96,6 @@ class ExternalApi extends DotNet::Callable {
84
96
defaultAdditionalTaintStep ( this .getAnInput ( ) , _)
85
97
}
86
98
87
- /** Holds if this API is a constructor without parameters. */
88
- private predicate isParameterlessConstructor ( ) {
89
- this instanceof Constructor and this .getNumberOfParameters ( ) = 0
90
- }
91
-
92
- /** Holds if this API is part of a common testing library or framework. */
93
- private predicate isTestLibrary ( ) { this .getDeclaringType ( ) instanceof TestLibrary }
94
-
95
- /** Holds if this API is not worth supporting. */
96
- predicate isUninteresting ( ) { this .isTestLibrary ( ) or this .isParameterlessConstructor ( ) }
97
-
98
99
/** Holds if this API is a known source. */
99
100
predicate isSource ( ) {
100
101
this .getAnOutput ( ) instanceof RemoteFlowSource or sourceNode ( this .getAnOutput ( ) , _)
0 commit comments