mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Add model validation for constructor summary models
This commit is contained in:
@@ -367,12 +367,24 @@ module ModelValidation {
|
||||
)
|
||||
}
|
||||
|
||||
string getIncorrectConstructorSummaryOutput() {
|
||||
exists(string namespace, string type, string name, string output |
|
||||
summaryModel(namespace, type, _, name, _, _, _, output, _, _, _)
|
||||
|
|
||||
type = name and
|
||||
output.matches("ReturnValue%") and
|
||||
result =
|
||||
"Constructor model for " + namespace + "." + type +
|
||||
" should use `Argument[this]` in the output, not `ReturnValue`."
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if some row in a MaD flow model appears to contain typos. */
|
||||
query predicate invalidModelRow(string msg) {
|
||||
msg =
|
||||
[
|
||||
getInvalidModelSignature(), getInvalidModelInput(), getInvalidModelOutput(),
|
||||
KindVal::getInvalidModelKind()
|
||||
getIncorrectConstructorSummaryOutput(), KindVal::getInvalidModelKind()
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
| Constructor model for java.net.URI should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
| Constructor model for java.util.zip.ZipEntry should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
| Constructor model for org.apache.hc.core5.http.io.entity.BasicHttpEntity should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
| Constructor model for org.apache.hc.core5.http.io.entity.BufferedHttpEntity should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
| Constructor model for org.apache.hc.core5.http.io.entity.HttpEntityWrapper should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
| Constructor model for org.apache.hc.core5.http.io.entity.InputStreamEntity should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
| Constructor model for org.apache.http.entity.BufferedHttpEntity should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
| Constructor model for org.apache.http.entity.HttpEntityWrapper should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
| Constructor model for org.apache.http.entity.InputStreamEntity should use `Argument[this]` in the output, not `ReturnValue`. |
|
||||
|
||||
Reference in New Issue
Block a user