mirror of
https://github.com/github/codeql.git
synced 2026-03-31 04:38:18 +02:00
Add model validation for constructor summary models
This commit is contained in:
@@ -239,12 +239,23 @@ module ModelValidation {
|
||||
)
|
||||
}
|
||||
|
||||
string getIncorrectConstructorSummaryOutput() {
|
||||
exists(string namespace, string type, string name, string output |
|
||||
summaryModel(namespace, type, _, name, _, _, _, output, _, _, _) and
|
||||
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()
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user