Skip to content

Commit 4c9e103

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 c8d7d0d commit 4c9e103

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,23 @@ import codeql.rust.Concepts
1111
import codeql.rust.Diagnostics
1212
import Stats
1313

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

0 commit comments

Comments
 (0)