@@ -24,14 +24,26 @@ class TestLibrary extends RefType {
2424 }
2525}
2626
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+
2738/**
2839 * An external API from either the C# Standard Library or a 3rd party library.
2940 */
3041class ExternalApi extends DotNet:: Callable {
3142 ExternalApi ( ) {
3243 this .isUnboundDeclaration ( ) and
3344 this .fromLibrary ( ) and
34- this .( Modifiable ) .isEffectivelyPublic ( )
45+ this .( Modifiable ) .isEffectivelyPublic ( ) and
46+ not isUninteresting ( this )
3547 }
3648
3749 /**
@@ -84,17 +96,6 @@ class ExternalApi extends DotNet::Callable {
8496 defaultAdditionalTaintStep ( this .getAnInput ( ) , _)
8597 }
8698
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-
9899 /** Holds if this API is a known source. */
99100 predicate isSource ( ) {
100101 this .getAnOutput ( ) instanceof RemoteFlowSource or sourceNode ( this .getAnOutput ( ) , _)
0 commit comments