Predicate restrictAlertsTo
Restricts alerts to a specific location in specific files.
If this predicate is empty, accept all alerts. Otherwise, accept alerts only at the specified locations. Note that alert restrictions apply only to the start line of an alert (even if the alert location spans multiple lines) because alerts are displayed on their start lines.
- filePath: Absolute path of the file to restrict alerts to.
- startLine: Start line number (starting with 1, inclusive) to restrict alerts to.
- endLine: End line number (starting with 1, inclusive) to restrict alerts to.
If startLine and endLine are both 0, accept alerts anywhere in the file.
A query should either completely ignore this predicate (i.e., perform no filtering whatsoever), or only return alerts that meet the filtering criteria as specified above.
Import path
import codeql.util.AlertFiltering
predicate restrictAlertsTo(string filePath, int startLine, int endLine)