From 7419e77a711d4ce8504f41e5964722f46ff13874 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Tue, 10 Dec 2024 12:37:26 +0100 Subject: [PATCH] Rust: ignore crate graph elements from summary stats These elements depend on the version of the standard libraries and platform --- rust/ql/src/queries/summary/SummaryStats.ql | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rust/ql/src/queries/summary/SummaryStats.ql b/rust/ql/src/queries/summary/SummaryStats.ql index 2e30fde143aa..36afb92d77f5 100644 --- a/rust/ql/src/queries/summary/SummaryStats.ql +++ b/rust/ql/src/queries/summary/SummaryStats.ql @@ -11,9 +11,21 @@ import codeql.rust.Concepts import codeql.rust.Diagnostics import Stats +class CrateElement extends Element { + CrateElement() { + this instanceof ModuleContainer or + this instanceof Type or + this instanceof ValueItem or + this instanceof TypeItem or + this instanceof VariantData or + this instanceof EnumVariant + } +} + from string key, int value where - key = "Elements extracted" and value = count(Element e | not e instanceof Unextracted) + key = "Elements extracted" and + value = count(Element e | not e instanceof Unextracted and not e instanceof CrateElement) or key = "Elements unextracted" and value = count(Unextracted e) or