mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
C#/Java/Ruby/Swift: Address review comments.
This commit is contained in:
@@ -639,12 +639,12 @@ module CsvValidation {
|
||||
}
|
||||
|
||||
private string getInvalidModelSubtype() {
|
||||
exists(string pred, string row, int expect |
|
||||
sourceModel(row) and expect = 9 and pred = "source"
|
||||
exists(string pred, string row |
|
||||
sourceModel(row) and pred = "source"
|
||||
or
|
||||
sinkModel(row) and expect = 9 and pred = "sink"
|
||||
sinkModel(row) and pred = "sink"
|
||||
or
|
||||
summaryModel(row) and expect = 10 and pred = "summary"
|
||||
summaryModel(row) and pred = "summary"
|
||||
|
|
||||
exists(string b |
|
||||
b = row.splitAt(";", 2) and
|
||||
|
||||
@@ -79,8 +79,8 @@ predicate summaryElement(Callable c, string input, string output, string kind, b
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if an external flow summary exists for `c` which means that there is no
|
||||
* flow through `c` and a flag `generated` stating whether the summary is autogenerated.
|
||||
* Holds if a negative flow summary exists for `c`, which means that there is no
|
||||
* flow through `c`. The flag `generated` states whether the summary is autogenerated.
|
||||
*/
|
||||
predicate negativeSummaryElement(Callable c, boolean generated) {
|
||||
exists(string namespace, string type, string name, string signature, string provenance |
|
||||
|
||||
@@ -50,8 +50,6 @@ private string asSummaryModel(TargetApi api, string input, string output, string
|
||||
|
||||
string asNegativeSummaryModel(TargetApi api) { result = asPartialNegativeModel(api) + "generated" }
|
||||
|
||||
predicate partialNegativeModel = asPartialNegativeModel/1;
|
||||
|
||||
/**
|
||||
* Gets the value summary model for `api` with `input` and `output`.
|
||||
*/
|
||||
|
||||
@@ -74,13 +74,9 @@ string captureFlow(TargetApi api) {
|
||||
|
||||
/**
|
||||
* Gets the negative summary for `api`, if any.
|
||||
* A negative summary is generated, if there does not exist any positive flow that
|
||||
* shares the same summary prefix - otherwise these models will be indistinguishable.
|
||||
* A negative summary is generated, if there does not exist any positive flow.
|
||||
*/
|
||||
string captureNoFlow(TargetApi api) {
|
||||
not exists(TargetApi other, string flow |
|
||||
flow = captureFlow(other) and
|
||||
partialNegativeModel(other) = partialNegativeModel(api)
|
||||
) and
|
||||
not exists(captureFlow(api)) and
|
||||
result = asNegativeSummaryModel(api)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user