Skip to content

Commit

Permalink
Change from package to endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
starcke committed Aug 2, 2023
1 parent 0c11668 commit fc8c7c8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ where
// modeled in a MaD model, then it doesn't belong to any additional sink types, and we don't need to reexamine it.
not CharacteristicsImpl::isSink(endpoint, _, _) and
meta.hasMetadata(endpoint, package, type, subtypes, name, signature, input) and
automodelCandidateFilter(package) and
includeAutomodelCandidate(package, type, name, signature) and
// The message is the concatenation of all sink types for which this endpoint is known neither to be a sink nor to be
// a non-sink, and we surface only endpoints that have at least one such sink type.
message =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ where
// modeled in a MaD model, then it doesn't belong to any additional sink types, and we don't need to reexamine it.
not CharacteristicsImpl::isSink(endpoint, _, _) and
meta.hasMetadata(endpoint, package, type, subtypes, name, signature, input, parameterName) and
automodelCandidateFilter(package) and
includeAutomodelCandidate(package, type, name, signature) and
// The message is the concatenation of all sink types for which this endpoint is known neither to be a sink nor to be
// a non-sink, and we surface only endpoints that have at least one such sink type.
message =
Expand Down
20 changes: 11 additions & 9 deletions java/ql/src/Telemetry/AutomodelJavaUtil.qll
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,22 @@ boolean considerSubtypes(Callable callable) {
}

/**
* Holds if the given package is a candidate for automodeling.
* Holds if the given package, type, name and signature is a candidate for automodeling.
*
* This predicate is extensible, so that different packages can be selected at runtime.
* This predicate is extensible, so that different endpoints can be selected at runtime.
*/
extensible predicate automodelCandidatePackageFilter(string package);
extensible predicate automodelCandidateFilter(
string package, string type, string name, string signature
);

/**
* Holds if the given package is a candidate for automodeling.
* Holds if the given package, type, name and signature is a candidate for automodeling.
*
* This relies on an extensible predicate, and if that is not supplied then
* all packages are considered candidates.
* all endpoints are considered candidates.
*/
bindingset[package]
predicate automodelCandidateFilter(string package) {
not automodelCandidatePackageFilter(_) or
automodelCandidatePackageFilter(package)
bindingset[package, type, name, signature]
predicate includeAutomodelCandidate(string package, string type, string name, string signature) {
not automodelCandidateFilter(_, _, _, _) or
automodelCandidateFilter(package, type, name, signature)
}

0 comments on commit fc8c7c8

Please sign in to comment.