CodeQL Tuning

This commit is contained in:
Alexey
2026-02-12 18:58:03 +03:00
parent 3c6752644a
commit 6e445be108
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import rust
predicate isTestOnly(Item i) {
exists(ConditionalCompilation cc |
cc.getItem() = i and
cc.getCfg().toString() = "test"
)
}
predicate hasTestAttribute(Item i) {
exists(Attribute a |
a.getItem() = i and
a.getName() = "test"
)
}
predicate isProductionCode(Item i) {
not isTestOnly(i) and
not hasTestAttribute(i)
}