@@ -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
/**
@@ -940,24 +940,20 @@ module MakeModelGeneratorFactory<
940
940
*/
941
941
class SourceTargetApi extends Callable ;
942
942
943
- /**
944
- * Holds if it is not relevant to generate a source model for `api`, even
945
- * if flow is detected from a node within `source` to a sink within `api`.
946
- */
947
- bindingset [ sourceEnclosing, api]
948
- predicate irrelevantSourceSinkApi ( Callable sourceEnclosing , SourceTargetApi api ) ;
949
-
950
- /**
951
- * Holds if `kind` is a relevant source kind for creating source models.
952
- */
953
- bindingset [ kind]
954
- predicate isRelevantSourceKind ( string kind ) ;
955
-
956
943
/**
957
944
* Holds if `node` is specified as a source with the given kind in a MaD flow
958
945
* model.
959
946
*/
960
947
predicate sourceNode ( Lang:: Node node , string kind ) ;
948
+
949
+ /**
950
+ * Holds if it is not relevant to generate a source model for `api`, even
951
+ * if flow is detected from a node within `source` to a sink within `api`.
952
+ */
953
+ bindingset [ sourceEnclosing, api]
954
+ default predicate irrelevantSourceSinkApi ( Callable sourceEnclosing , SourceTargetApi api ) {
955
+ none ( )
956
+ }
961
957
}
962
958
963
959
/**
@@ -970,31 +966,31 @@ module MakeModelGeneratorFactory<
970
966
class SinkTargetApi extends Callable ;
971
967
972
968
/**
973
- * Gets the MaD input string representation of `source`.
969
+ * Holds if `node` is specified as a sink with the given kind in a MaD flow
970
+ * model.
974
971
*/
975
- string getInputArgument ( Lang:: Node source ) ;
972
+ predicate sinkNode ( Lang:: Node node , string kind ) ;
976
973
977
974
/**
978
- * Holds if `node` is a sanitizer for sink model construction .
975
+ * Gets the MaD input string representation of `source` .
979
976
*/
980
- predicate sinkModelSanitizer ( Lang:: Node node ) ;
977
+ string getInputArgument ( Lang:: Node source ) ;
981
978
982
979
/**
983
980
* Holds if `source` is an api entrypoint relevant for creating sink models.
984
981
*/
985
982
predicate apiSource ( Lang:: Node source ) ;
986
983
987
984
/**
988
- * Holds if `kind ` is a relevant sink kind for creating sink models .
985
+ * Holds if `node ` is a sanitizer for sink model construction .
989
986
*/
990
- bindingset [ kind]
991
- predicate isRelevantSinkKind ( string kind ) ;
987
+ default predicate sinkModelSanitizer ( Lang:: Node node ) { none ( ) }
992
988
993
989
/**
994
- * Holds if `node` is specified as a sink with the given kind in a MaD flow
995
- * model.
990
+ * Holds if `kind` is a relevant sink kind for creating sink models.
996
991
*/
997
- predicate sinkNode ( Lang:: Node node , string kind ) ;
992
+ bindingset [ kind]
993
+ default predicate isRelevantSinkKind ( string kind ) { any ( ) }
998
994
}
999
995
1000
996
/**
@@ -1029,12 +1025,7 @@ module MakeModelGeneratorFactory<
1029
1025
* via its return (then the API itself becomes a source).
1030
1026
*/
1031
1027
module PropagateFromSourceConfig implements DataFlow:: ConfigSig {
1032
- predicate isSource ( DataFlow:: Node source ) {
1033
- exists ( string kind |
1034
- isRelevantSourceKind ( kind ) and
1035
- sourceNode ( source , kind )
1036
- )
1037
- }
1028
+ predicate isSource ( DataFlow:: Node source ) { sourceNode ( source , _) }
1038
1029
1039
1030
predicate isSink ( DataFlow:: Node sink ) {
1040
1031
sink instanceof ReturnNodeExt and
0 commit comments