We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c880df commit 6f5ac5dCopy full SHA for 6f5ac5d
1 file changed
.github/codeql/queries/unique-command-use.ql
@@ -26,7 +26,12 @@
26
/**
27
* In how many ways is this command used. Will always be at least 1.
28
*/
29
- int getNumberOfUsages() { result = count(CommandUsage e | e.getCommandName() = this | e) }
+ int getNumberOfUsages() { result = count(this.getAUse()) }
30
+
31
+ /**
32
+ * Get a usage of this command.
33
+ */
34
+ CommandUsage getAUse() { result.getCommandName() = this }
35
36
37
* Get the canonical first usage of this command, to use for the location
@@ -35,10 +40,7 @@
40
* the alert.
41
42
CommandUsage getFirstUsage() {
38
- result.getCommandName() = this and
39
- forall(CommandUsage e | e.getCommandName() = this |
- e.getLocationOrdinal() >= result.getLocationOrdinal()
- )
43
+ result = max(CommandUsage use | use = this.getAUse() | use order by use.getLocationOrdinal())
44
}
45
46
0 commit comments