Skip to content

Commit 6d7401d

Browse files
committed
C#: Rename the extensible predicates related to external flow.
1 parent 6023a12 commit 6d7401d

File tree

2 files changed

+40
-33
lines changed

2 files changed

+40
-33
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
*/
8383

8484
import csharp
85+
private import ExternalFlowExtensions as Extensions
8586
private import internal.AccessPathSyntax
8687
private import internal.DataFlowDispatch
8788
private import internal.DataFlowPrivate
@@ -138,14 +139,6 @@ private predicate summaryModelInternal(string row) { any(SummaryModelCsvInternal
138139

139140
private predicate sinkModelInternal(string row) { any(SinkModelCsvInternal s).row(row) }
140141

141-
/**
142-
* Holds if a source model exists for the given parameters.
143-
*/
144-
extensible predicate extSourceModel(
145-
string namespace, string type, boolean subtypes, string name, string signature, string ext,
146-
string output, string kind, string provenance
147-
);
148-
149142
/** Holds if a source model exists for the given parameters. */
150143
predicate sourceModel(
151144
string namespace, string type, boolean subtypes, string name, string signature, string ext,
@@ -165,15 +158,9 @@ predicate sourceModel(
165158
row.splitAt(";", 8) = provenance
166159
)
167160
or
168-
extSourceModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance)
161+
Extensions::sourceModel(namespace, type, subtypes, name, signature, ext, output, kind, provenance)
169162
}
170163

171-
/** Holds if a sink model exists for the given parameters. */
172-
extensible predicate extSinkModel(
173-
string namespace, string type, boolean subtypes, string name, string signature, string ext,
174-
string input, string kind, string provenance
175-
);
176-
177164
/** Holds if a sink model exists for the given parameters. */
178165
predicate sinkModel(
179166
string namespace, string type, boolean subtypes, string name, string signature, string ext,
@@ -193,15 +180,9 @@ predicate sinkModel(
193180
row.splitAt(";", 8) = provenance
194181
)
195182
or
196-
extSinkModel(namespace, type, subtypes, name, signature, ext, input, kind, provenance)
183+
Extensions::sinkModel(namespace, type, subtypes, name, signature, ext, input, kind, provenance)
197184
}
198185

199-
/** Holds if a summary model exists for the given parameters. */
200-
extensible predicate extSummaryModel(
201-
string namespace, string type, boolean subtypes, string name, string signature, string ext,
202-
string input, string output, string kind, string provenance
203-
);
204-
205186
/** Holds if a summary model exists for the given parameters. */
206187
predicate summaryModel(
207188
string namespace, string type, boolean subtypes, string name, string signature, string ext,
@@ -222,20 +203,12 @@ predicate summaryModel(
222203
row.splitAt(";", 9) = provenance
223204
)
224205
or
225-
extSummaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance)
206+
Extensions::summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind,
207+
provenance)
226208
}
227209

228210
/** Holds if a model exists indicating there is no flow for the given parameters. */
229-
extensible predicate extNeutralModel(
230-
string namespace, string type, string name, string signature, string provenance
231-
);
232-
233-
/** Holds if a model exists indicating there is no flow for the given parameters. */
234-
predicate neutralModel(
235-
string namespace, string type, string name, string signature, string provenance
236-
) {
237-
extNeutralModel(namespace, type, name, signature, provenance)
238-
}
211+
predicate neutralModel = Extensions::neutralModel/5;
239212

240213
private predicate relevantNamespace(string namespace) {
241214
sourceModel(namespace, _, _, _, _, _, _, _, _) or
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* This module provides extensible predicates for defining MaD models.
3+
*/
4+
5+
/**
6+
* Holds if a source model exists for the given parameters.
7+
*/
8+
extensible predicate sourceModel(
9+
string namespace, string type, boolean subtypes, string name, string signature, string ext,
10+
string output, string kind, string provenance
11+
);
12+
13+
/**
14+
* Holds if a sink model exists for the given parameters.
15+
*/
16+
extensible predicate sinkModel(
17+
string namespace, string type, boolean subtypes, string name, string signature, string ext,
18+
string input, string kind, string provenance
19+
);
20+
21+
/**
22+
* Holds if a summary model exists for the given parameters.
23+
*/
24+
extensible predicate summaryModel(
25+
string namespace, string type, boolean subtypes, string name, string signature, string ext,
26+
string input, string output, string kind, string provenance
27+
);
28+
29+
/**
30+
* Holds if a model exists indicating there is no flow for the given parameters.
31+
*/
32+
extensible predicate neutralModel(
33+
string namespace, string type, string name, string signature, string provenance
34+
);

0 commit comments

Comments
 (0)