File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
rust/ql/consistency-queries Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ import rust
2
+ import codeql.rust.elements.internal.generated.ParentChild
3
+
4
+ query predicate multipleToString ( Element e , string s ) {
5
+ s = strictconcat ( e .toString ( ) , "," ) and
6
+ strictcount ( e .toString ( ) ) > 1
7
+ }
8
+
9
+ query predicate multipleLocations ( Locatable e ) { strictcount ( e .getLocation ( ) ) > 1 }
10
+
11
+ query predicate multiplePrimaryQlClasses ( Element e , string s ) {
12
+ s = e .getPrimaryQlClasses ( ) and
13
+ strictcount ( e .getAPrimaryQlClass ( ) ) > 1
14
+ }
15
+
16
+ private Element getParent ( Element child ) { child = getChildAndAccessor ( result , _, _) }
17
+
18
+ query predicate multipleParents ( Element child , Element parent ) {
19
+ parent = getParent ( child ) and
20
+ strictcount ( getParent ( child ) ) > 1
21
+ }
You can’t perform that action at this time.
0 commit comments