Skip to content

Commit 761ed28

Browse files
committed
C#/Java/Ruby/Swift: Address review comments.
1 parent f728ddf commit 761ed28

File tree

12 files changed

+28
-40
lines changed

12 files changed

+28
-40
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,12 @@ module CsvValidation {
371371
}
372372

373373
private string getInvalidModelSubtype() {
374-
exists(string pred, string row, int expect |
375-
sourceModel(row) and expect = 9 and pred = "source"
374+
exists(string pred, string row |
375+
sourceModel(row) and pred = "source"
376376
or
377-
sinkModel(row) and expect = 9 and pred = "sink"
377+
sinkModel(row) and pred = "sink"
378378
or
379-
summaryModel(row) and expect = 10 and pred = "summary"
379+
summaryModel(row) and pred = "summary"
380380
|
381381
exists(string b |
382382
b = row.splitAt(";", 2) and

csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ predicate summaryElement(Callable c, string input, string output, string kind, b
115115
}
116116

117117
/**
118-
* Holds if an external flow summary exists for `c` which means that there is no
119-
* flow through `c` and a flag `generated` stating whether the summary is autogenerated.
118+
* Holds if a negative flow summary exists for `c`, which means that there is no
119+
* flow through `c`. The flag `generated` states whether the summary is autogenerated.
120120
*/
121121
predicate negativeSummaryElement(Callable c, boolean generated) {
122122
exists(string namespace, string type, string name, string signature, string provenance |

csharp/ql/src/utils/model-generator/internal/CaptureModels.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ private string asSummaryModel(TargetApi api, string input, string output, string
5050

5151
string asNegativeSummaryModel(TargetApi api) { result = asPartialNegativeModel(api) + "generated" }
5252

53-
predicate partialNegativeModel = asPartialNegativeModel/1;
54-
5553
/**
5654
* Gets the value summary model for `api` with `input` and `output`.
5755
*/

csharp/ql/src/utils/model-generator/internal/CaptureSummaryFlow.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,9 @@ string captureFlow(TargetApi api) {
8282

8383
/**
8484
* Gets the negative summary for `api`, if any.
85-
* A negative summary is generated, if there does not exist any positive flow that
86-
* shares the same summary prefix - otherwise these models will be indistinguishable.
85+
* A negative summary is generated, if there does not exist any positive flow.
8786
*/
8887
string captureNoFlow(TargetApi api) {
89-
not exists(TargetApi other, string flow |
90-
flow = captureFlow(other) and
91-
partialNegativeModel(other) = partialNegativeModel(api)
92-
) and
88+
not exists(captureFlow(api)) and
9389
result = asNegativeSummaryModel(api)
9490
}

go/ql/lib/semmle/go/dataflow/ExternalFlow.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@ module CsvValidation {
299299
}
300300

301301
private string getInvalidModelSubtype() {
302-
exists(string pred, string row, int expect |
303-
sourceModel(row) and expect = 8 and pred = "source"
302+
exists(string pred, string row |
303+
sourceModel(row) and pred = "source"
304304
or
305-
sinkModel(row) and expect = 8 and pred = "sink"
305+
sinkModel(row) and pred = "sink"
306306
or
307-
summaryModel(row) and expect = 9 and pred = "summary"
307+
summaryModel(row) and pred = "summary"
308308
|
309309
exists(string b |
310310
b = row.splitAt(";", 2) and

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,12 @@ module CsvValidation {
639639
}
640640

641641
private string getInvalidModelSubtype() {
642-
exists(string pred, string row, int expect |
643-
sourceModel(row) and expect = 9 and pred = "source"
642+
exists(string pred, string row |
643+
sourceModel(row) and pred = "source"
644644
or
645-
sinkModel(row) and expect = 9 and pred = "sink"
645+
sinkModel(row) and pred = "sink"
646646
or
647-
summaryModel(row) and expect = 10 and pred = "summary"
647+
summaryModel(row) and pred = "summary"
648648
|
649649
exists(string b |
650650
b = row.splitAt(";", 2) and

java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ predicate summaryElement(Callable c, string input, string output, string kind, b
7979
}
8080

8181
/**
82-
* Holds if an external flow summary exists for `c` which means that there is no
83-
* flow through `c` and a flag `generated` stating whether the summary is autogenerated.
82+
* Holds if a negative flow summary exists for `c`, which means that there is no
83+
* flow through `c`. The flag `generated` states whether the summary is autogenerated.
8484
*/
8585
predicate negativeSummaryElement(Callable c, boolean generated) {
8686
exists(string namespace, string type, string name, string signature, string provenance |

java/ql/src/utils/model-generator/internal/CaptureModels.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ private string asSummaryModel(TargetApi api, string input, string output, string
5050

5151
string asNegativeSummaryModel(TargetApi api) { result = asPartialNegativeModel(api) + "generated" }
5252

53-
predicate partialNegativeModel = asPartialNegativeModel/1;
54-
5553
/**
5654
* Gets the value summary model for `api` with `input` and `output`.
5755
*/

java/ql/src/utils/model-generator/internal/CaptureSummaryFlow.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,9 @@ string captureFlow(TargetApi api) {
7474

7575
/**
7676
* Gets the negative summary for `api`, if any.
77-
* A negative summary is generated, if there does not exist any positive flow that
78-
* shares the same summary prefix - otherwise these models will be indistinguishable.
77+
* A negative summary is generated, if there does not exist any positive flow.
7978
*/
8079
string captureNoFlow(TargetApi api) {
81-
not exists(TargetApi other, string flow |
82-
flow = captureFlow(other) and
83-
partialNegativeModel(other) = partialNegativeModel(api)
84-
) and
80+
not exists(captureFlow(api)) and
8581
result = asNegativeSummaryModel(api)
8682
}

ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ predicate summaryElement(
6060
}
6161

6262
/**
63-
* Holds if an external flow summary exists for `c` which means that there is no
64-
* flow through `c` and a flag `generated` stating whether the summary is autogenerated.
63+
* Holds if a negative flow summary exists for `c`, which means that there is no
64+
* flow through `c`. The flag `generated` states whether the summary is autogenerated.
6565
* Note. Negative flow summaries has not been implemented for ruby.
6666
*/
6767
predicate negativeSummaryElement(FlowSummary::SummarizedCallable c, boolean generated) { none() }

0 commit comments

Comments
 (0)