Skip to content

Commit 8053d5c

Browse files
committed
Rust: ignore crate graph elements from summary stats
These elements depend on the version of the standard libraries and platform
1 parent 092cbc7 commit 8053d5c

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

rust/ql/src/queries/summary/SummaryStats.ql

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@ import codeql.rust.security.SensitiveData
1212
import codeql.rust.Diagnostics
1313
import Stats
1414

15+
class CrateElement extends Element {
16+
CrateElement() {
17+
this instanceof ModuleContainer or
18+
this instanceof Type or
19+
this instanceof ValueItem or
20+
this instanceof TypeItem or
21+
this instanceof VariantData or
22+
this instanceof EnumVariant or
23+
this instanceof ImplItem or
24+
this instanceof TypeBoundType
25+
}
26+
}
27+
1528
from string key, int value
1629
where
17-
key = "Elements extracted" and value = count(Element e | not e instanceof Unextracted)
30+
key = "Elements extracted" and
31+
value = count(Element e | not e instanceof Unextracted and not e instanceof CrateElement)
1832
or
1933
key = "Elements unextracted" and value = count(Unextracted e)
2034
or

0 commit comments

Comments
 (0)