@@ -295,7 +295,7 @@ module MakeModelGeneratorFactory<
295
295
*
296
296
* This serves as an extra filter for the `relevant` predicate.
297
297
*/
298
- predicate isUninterestingForDataFlowModels ( Callable api ) ;
298
+ default predicate isUninterestingForDataFlowModels ( Callable api ) { none ( ) }
299
299
300
300
/**
301
301
* Holds if it is irrelevant to generate models for `api` based on the heuristic
@@ -304,7 +304,7 @@ module MakeModelGeneratorFactory<
304
304
* This serves as an extra filter for the `relevant`
305
305
* and `isUninterestingForDataFlowModels` predicates.
306
306
*/
307
- predicate isUninterestingForHeuristicDataFlowModels ( Callable api ) ;
307
+ default predicate isUninterestingForHeuristicDataFlowModels ( Callable api ) { none ( ) }
308
308
}
309
309
310
310
/**
@@ -936,24 +936,20 @@ module MakeModelGeneratorFactory<
936
936
*/
937
937
class SourceTargetApi extends Callable ;
938
938
939
- /**
940
- * Holds if it is not relevant to generate a source model for `api`, even
941
- * if flow is detected from a node within `source` to a sink within `api`.
942
- */
943
- bindingset [ sourceEnclosing, api]
944
- predicate irrelevantSourceSinkApi ( Callable sourceEnclosing , SourceTargetApi api ) ;
945
-
946
- /**
947
- * Holds if `kind` is a relevant source kind for creating source models.
948
- */
949
- bindingset [ kind]
950
- predicate isRelevantSourceKind ( string kind ) ;
951
-
952
939
/**
953
940
* Holds if `node` is specified as a source with the given kind in a MaD flow
954
941
* model.
955
942
*/
956
943
predicate sourceNode ( Lang:: Node node , string kind ) ;
944
+
945
+ /**
946
+ * Holds if it is not relevant to generate a source model for `api`, even
947
+ * if flow is detected from a node within `source` to a sink within `api`.
948
+ */
949
+ bindingset [ sourceEnclosing, api]
950
+ default predicate irrelevantSourceSinkApi ( Callable sourceEnclosing , SourceTargetApi api ) {
951
+ none ( )
952
+ }
957
953
}
958
954
959
955
/**
@@ -966,31 +962,31 @@ module MakeModelGeneratorFactory<
966
962
class SinkTargetApi extends Callable ;
967
963
968
964
/**
969
- * Gets the MaD input string representation of `source`.
965
+ * Holds if `node` is specified as a sink with the given kind in a MaD flow
966
+ * model.
970
967
*/
971
- string getInputArgument ( Lang:: Node source ) ;
968
+ predicate sinkNode ( Lang:: Node node , string kind ) ;
972
969
973
970
/**
974
- * Holds if `node` is a sanitizer for sink model construction .
971
+ * Gets the MaD input string representation of `source` .
975
972
*/
976
- predicate sinkModelSanitizer ( Lang:: Node node ) ;
973
+ string getInputArgument ( Lang:: Node source ) ;
977
974
978
975
/**
979
976
* Holds if `source` is an api entrypoint relevant for creating sink models.
980
977
*/
981
978
predicate apiSource ( Lang:: Node source ) ;
982
979
983
980
/**
984
- * Holds if `kind ` is a relevant sink kind for creating sink models .
981
+ * Holds if `node ` is a sanitizer for sink model construction .
985
982
*/
986
- bindingset [ kind]
987
- predicate isRelevantSinkKind ( string kind ) ;
983
+ default predicate sinkModelSanitizer ( Lang:: Node node ) { none ( ) }
988
984
989
985
/**
990
- * Holds if `node` is specified as a sink with the given kind in a MaD flow
991
- * model.
986
+ * Holds if `kind` is a relevant sink kind for creating sink models.
992
987
*/
993
- predicate sinkNode ( Lang:: Node node , string kind ) ;
988
+ bindingset [ kind]
989
+ default predicate isRelevantSinkKind ( string kind ) { any ( ) }
994
990
}
995
991
996
992
/**
@@ -1025,12 +1021,7 @@ module MakeModelGeneratorFactory<
1025
1021
* via its return (then the API itself becomes a source).
1026
1022
*/
1027
1023
module PropagateFromSourceConfig implements DataFlow:: ConfigSig {
1028
- predicate isSource ( DataFlow:: Node source ) {
1029
- exists ( string kind |
1030
- isRelevantSourceKind ( kind ) and
1031
- sourceNode ( source , kind )
1032
- )
1033
- }
1024
+ predicate isSource ( DataFlow:: Node source ) { sourceNode ( source , _) }
1034
1025
1035
1026
predicate isSink ( DataFlow:: Node sink ) {
1036
1027
sink instanceof ReturnNodeExt and
0 commit comments