mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
26 lines
974 B
Plaintext
26 lines
974 B
Plaintext
/*
|
|
* For internal use only.
|
|
*
|
|
* Extracts evaluation data we can use to evaluate ML models for ML-powered queries.
|
|
*/
|
|
|
|
import javascript
|
|
import ExtractEndpointData as ExtractEndpointData
|
|
|
|
query predicate endpoints(
|
|
DataFlow::Node endpoint, string queryName, string key, string value, string valueType
|
|
) {
|
|
ExtractEndpointData::endpoints(endpoint, queryName, key, value, valueType) and
|
|
// only select endpoints that are either Sink, NotASink or Unknown
|
|
ExtractEndpointData::endpoints(endpoint, queryName, "sinkLabel", ["Sink", "NotASink", "Unknown"],
|
|
"string") and
|
|
// do not select endpoints filtered out by end-to-end evaluation
|
|
ExtractEndpointData::endpoints(endpoint, queryName, "isExcludedFromEndToEndEvaluation", "false",
|
|
"boolean")
|
|
}
|
|
|
|
query predicate tokenFeatures(DataFlow::Node endpoint, string featureName, string featureValue) {
|
|
endpoints(endpoint, _, _, _, _) and
|
|
ExtractEndpointData::tokenFeatures(endpoint, featureName, featureValue)
|
|
}
|