File tree Expand file tree Collapse file tree 6 files changed +25
-15
lines changed
csharp/ql/src/utils/modelgenerator/internal
java/ql/src/utils/modelgenerator/internal Expand file tree Collapse file tree 6 files changed +25
-15
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ private import CaptureModelsSpecific
7
7
private import CaptureModelsPrinting
8
8
9
9
class DataFlowTargetApi extends TargetApiSpecific {
10
- DataFlowTargetApi ( ) { isRelevantForDataFlowModels ( this ) }
10
+ DataFlowTargetApi ( ) { not isUninterestingForDataFlowModels ( this ) }
11
11
}
12
12
13
13
private module Printing implements PrintingSig {
Original file line number Diff line number Diff line change @@ -51,16 +51,18 @@ private predicate isRelevantForModels(CS::Callable api) {
51
51
}
52
52
53
53
/**
54
- * Holds if it is relevant to generate models for `api` based on data flow analysis.
54
+ * Holds if it is irrelevant to generate models for `api` based on data flow analysis.
55
+ *
56
+ * This serves as an extra filter for the `relevant` predicate.
55
57
*/
56
- predicate isRelevantForDataFlowModels ( CS:: Callable api ) {
57
- isRelevantForModels ( api ) and not isHigherOrder ( api )
58
- }
58
+ predicate isUninterestingForDataFlowModels ( CS:: Callable api ) { isHigherOrder ( api ) }
59
59
60
60
/**
61
- * Holds if it is relevant to generate models for `api` based on its type.
61
+ * Holds if it is irrelevant to generate models for `api` based on type-based analysis.
62
+ *
63
+ * This serves as an extra filter for the `relevant` predicate.
62
64
*/
63
- predicate isRelevantForTypeBasedFlowModels = isRelevantForModels / 1 ;
65
+ predicate isUninterestingForTypeBasedFlowModels ( CS :: Callable api ) { none ( ) }
64
66
65
67
/**
66
68
* A class of callables that are relevant generating summary, source and sinks models for.
@@ -71,7 +73,8 @@ predicate isRelevantForTypeBasedFlowModels = isRelevantForModels/1;
71
73
class TargetApiSpecific extends CS:: Callable {
72
74
TargetApiSpecific ( ) {
73
75
this .fromSource ( ) and
74
- this .isUnboundDeclaration ( )
76
+ this .isUnboundDeclaration ( ) and
77
+ isRelevantForModels ( this )
75
78
}
76
79
}
77
80
Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ private module ModelPrinting = PrintingImpl<Printing>;
190
190
* on the Theorems for Free approach.
191
191
*/
192
192
class TypeBasedFlowTargetApi extends Specific:: TargetApiSpecific {
193
- TypeBasedFlowTargetApi ( ) { Specific:: isRelevantForTypeBasedFlowModels ( this ) }
193
+ TypeBasedFlowTargetApi ( ) { not Specific:: isUninterestingForTypeBasedFlowModels ( this ) }
194
194
195
195
/**
196
196
* Gets the string representation of all type based summaries for `this`
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ private import CaptureModelsSpecific
7
7
private import CaptureModelsPrinting
8
8
9
9
class DataFlowTargetApi extends TargetApiSpecific {
10
- DataFlowTargetApi ( ) { isRelevantForDataFlowModels ( this ) }
10
+ DataFlowTargetApi ( ) { not isUninterestingForDataFlowModels ( this ) }
11
11
}
12
12
13
13
private module Printing implements PrintingSig {
Original file line number Diff line number Diff line change @@ -63,13 +63,20 @@ private predicate hasManualModel(Callable api) {
63
63
}
64
64
65
65
/**
66
- * Holds if it is relevant to generate models for `api` based on data flow analysis.
66
+ * Holds if it is irrelevant to generate models for `api` based on data flow analysis.
67
+ *
68
+ * This serves as an extra filter for the `relevant` predicate.
67
69
*/
68
- predicate isRelevantForDataFlowModels ( Callable api ) {
69
- ( not api .getDeclaringType ( ) instanceof J:: Interface or exists ( api .getBody ( ) ) )
70
+ predicate isUninterestingForDataFlowModels ( Callable api ) {
71
+ api .getDeclaringType ( ) instanceof J:: Interface and not exists ( api .getBody ( ) )
70
72
}
71
73
72
- predicate isRelevantForTypeBasedFlowModels ( Callable api ) { any ( ) }
74
+ /**
75
+ * Holds if it is irrelevant to generate models for `api` based on type-based analysis.
76
+ *
77
+ * This serves as an extra filter for the `relevant` predicate.
78
+ */
79
+ predicate isUninterestingForTypeBasedFlowModels ( Callable api ) { none ( ) }
73
80
74
81
/**
75
82
* A class of Callables that are relevant for generating summary, source and sinks models for.
Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ private module ModelPrinting = PrintingImpl<Printing>;
296
296
* on the Theorems for Free approach.
297
297
*/
298
298
class TypeBasedFlowTargetApi extends Specific:: TargetApiSpecific {
299
- TypeBasedFlowTargetApi ( ) { Specific:: isRelevantForTypeBasedFlowModels ( this ) }
299
+ TypeBasedFlowTargetApi ( ) { not Specific:: isUninterestingForTypeBasedFlowModels ( this ) }
300
300
301
301
/**
302
302
* Gets the string representation of all type based summaries for `this`
You can’t perform that action at this time.
0 commit comments