mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Java: Move instance counting logic into utility library
This commit is contained in:
@@ -61,6 +61,9 @@ class SinkModel extends TSinkModel {
|
||||
/** Gets the provenance for this sink model. */
|
||||
string getProvenance() { result = provenance }
|
||||
|
||||
/** Gets the number of instances of this sink model. */
|
||||
int getInstanceCount() { result = count(PotentialSinkModelExpr p | p.getSinkModel() = this) }
|
||||
|
||||
/** Gets a string representation of this sink model. */
|
||||
string toString() {
|
||||
result =
|
||||
|
||||
@@ -11,7 +11,8 @@ private import AutomodelAlertSinkUtil
|
||||
|
||||
from int instanceCount, SinkModel s
|
||||
where
|
||||
instanceCount = strictcount(PotentialSinkModelExpr p | p.getSinkModel() = s) and
|
||||
instanceCount = s.getInstanceCount() and
|
||||
instanceCount > 0 and
|
||||
s.getProvenance() = "ai-generated"
|
||||
select instanceCount, s.getPackage() as package, s.getType() as type, s.getSubtypes() as subtypes,
|
||||
s.getName() as name, s.getSignature() as signature, s.getInput() as input, s.getExt() as ext,
|
||||
|
||||
Reference in New Issue
Block a user