Skip to content

Commit bf397c1

Browse files
committed
Fixes for failing PR checks
- Syncs "server/dist/**" - Applies "codeql query format" rules for all server/ql/**/*.ql files - Fixes formatting of markdown text in query markdown docs - Addresses other PR review feedback for #168
1 parent d578cec commit bf397c1

File tree

47 files changed

+180
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+180
-283
lines changed

server/dist/codeql-development-mcp-server.js

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

server/dist/codeql-development-mcp-server.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/ql/actions/tools/src/PrintCFG/PrintCFG.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ query predicate nodes(Node node, string property, string value) {
1818
value = node.toString()
1919
}
2020

21-
query predicate edges(Node pred, Node succ) {
22-
pred.getASuccessor() = succ
23-
}
21+
query predicate edges(Node pred, Node succ) { pred.getASuccessor() = succ }

server/ql/cpp/tools/src/CallGraphFrom/CallGraphFrom.ql

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ external string sourceFunction();
1818
/**
1919
* Gets a single source function name from the comma-separated list.
2020
*/
21-
string getSourceFunctionName() {
22-
result = sourceFunction().splitAt(",").trim()
23-
}
21+
string getSourceFunctionName() { result = sourceFunction().splitAt(",").trim() }
2422

2523
/**
2624
* Gets a function by matching against the selected source function names.
@@ -30,7 +28,8 @@ Function getSourceFunction() {
3028
selectedFunc = getSourceFunctionName() and
3129
(
3230
// Match by exact function name
33-
result.getName() = selectedFunc or
31+
result.getName() = selectedFunc
32+
or
3433
// Match by qualified name
3534
result.getQualifiedName() = selectedFunc
3635
)
@@ -46,10 +45,7 @@ where
4645
source = getSourceFunction()
4746
or
4847
// Fallback for unit tests: include test files
49-
(
50-
not exists(getSourceFunction()) and
51-
source.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
52-
)
48+
not exists(getSourceFunction()) and
49+
source.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
5350
)
54-
select call,
55-
"Call from `" + source.getQualifiedName() + "` to `" + callee.getQualifiedName() + "`"
51+
select call, "Call from `" + source.getQualifiedName() + "` to `" + callee.getQualifiedName() + "`"

server/ql/cpp/tools/src/CallGraphFromTo/CallGraphFromTo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void source() {
3333
}
3434
```
3535

36-
Running with `sourceFunction = "source"` and `targetFunction = "target"` produces results showing each call site on the path with the message pattern ``Reachable call from `source`to`intermediate```.
36+
Running with `sourceFunction = "source"` and `targetFunction = "target"` produces results showing each call site on the path with a message like: "Reachable call from `source` to `intermediate`".
3737

3838
## Output Format
3939

server/ql/cpp/tools/src/CallGraphFromTo/CallGraphFromTo.ql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Function getSourceFunction() {
3939
selectedFunc = getSourceFunctionName() and
4040
(
4141
// Match by exact function name
42-
result.getName() = selectedFunc or
42+
result.getName() = selectedFunc
43+
or
4344
// Match by qualified name
4445
result.getQualifiedName() = selectedFunc
4546
)
@@ -54,7 +55,8 @@ Function getTargetFunction() {
5455
selectedFunc = getTargetFunctionName() and
5556
(
5657
// Match by exact function name
57-
result.getName() = selectedFunc or
58+
result.getName() = selectedFunc
59+
or
5860
// Match by qualified name
5961
result.getQualifiedName() = selectedFunc
6062
)
@@ -82,11 +84,9 @@ where
8284
)
8385
or
8486
// Fallback for unit tests: include test files
85-
(
86-
not exists(getSourceFunctionName()) and
87-
not exists(getTargetFunctionName()) and
88-
caller.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
89-
)
87+
not exists(getSourceFunctionName()) and
88+
not exists(getTargetFunctionName()) and
89+
caller.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
9090
)
9191
select call,
9292
"Reachable call from `" + caller.getQualifiedName() + "` to `" + callee.getQualifiedName() + "`"

server/ql/cpp/tools/src/CallGraphTo/CallGraphTo.ql

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ external string targetFunction();
1818
/**
1919
* Gets a single target function name from the comma-separated list.
2020
*/
21-
string getTargetFunctionName() {
22-
result = targetFunction().splitAt(",").trim()
23-
}
21+
string getTargetFunctionName() { result = targetFunction().splitAt(",").trim() }
2422

2523
/**
2624
* Gets a function by matching against the selected target function names.
@@ -30,7 +28,8 @@ Function getTargetFunction() {
3028
selectedFunc = getTargetFunctionName() and
3129
(
3230
// Match by exact function name
33-
result.getName() = selectedFunc or
31+
result.getName() = selectedFunc
32+
or
3433
// Match by qualified name
3534
result.getQualifiedName() = selectedFunc
3635
)
@@ -46,10 +45,7 @@ where
4645
target = getTargetFunction()
4746
or
4847
// Fallback for unit tests: include test files
49-
(
50-
not exists(getTargetFunction()) and
51-
target.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
52-
)
48+
not exists(getTargetFunction()) and
49+
target.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
5350
)
54-
select call,
55-
"Call to `" + target.getQualifiedName() + "` from `" + caller.getQualifiedName() + "`"
51+
select call, "Call to `" + target.getQualifiedName() + "` from `" + caller.getQualifiedName() + "`"

server/ql/cpp/tools/src/PrintAST/PrintAST.ql

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ external string selectedSourceFiles();
1818
/**
1919
* Gets a single source file from the comma-separated list.
2020
*/
21-
string getSelectedSourceFile() {
22-
result = selectedSourceFiles().splitAt(",").trim()
23-
}
21+
string getSelectedSourceFile() { result = selectedSourceFiles().splitAt(",").trim() }
2422

2523
/**
2624
* Gets a file by matching against the selected source file paths.
@@ -30,11 +28,14 @@ File getSelectedFile() {
3028
selectedFile = getSelectedSourceFile() and
3129
(
3230
// Match by exact relative path from source root
33-
result.getRelativePath() = selectedFile or
31+
result.getRelativePath() = selectedFile
32+
or
3433
// Match by file name if no path separators
35-
(not selectedFile.matches("%/%") and result.getBaseName() = selectedFile) or
34+
not selectedFile.matches("%/%") and result.getBaseName() = selectedFile
35+
or
3636
// Match by ending path component
37-
result.getAbsolutePath().suffix(result.getAbsolutePath().length() - selectedFile.length()) = selectedFile
37+
result.getAbsolutePath().suffix(result.getAbsolutePath().length() - selectedFile.length()) =
38+
selectedFile
3839
)
3940
)
4041
}
@@ -49,9 +50,7 @@ class Cfg extends PrintAstConfiguration {
4950
decl.getFile() = getSelectedFile()
5051
or
5152
// Fallback for unit tests: include test files
52-
(
53-
not exists(getSelectedFile()) and
54-
decl.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
55-
)
53+
not exists(getSelectedFile()) and
54+
decl.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
5655
}
5756
}

server/ql/cpp/tools/src/PrintCFG/PrintCFG.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@ query predicate nodes(ControlFlowNode node, string property, string value) {
1717
value = node.toString()
1818
}
1919

20-
query predicate edges(ControlFlowNode pred, ControlFlowNode succ) {
21-
pred.getASuccessor() = succ
22-
}
20+
query predicate edges(ControlFlowNode pred, ControlFlowNode succ) { pred.getASuccessor() = succ }

server/ql/csharp/tools/src/CallGraphFrom/CallGraphFrom.ql

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ external string sourceFunction();
1818
/**
1919
* Gets a single source method name from the comma-separated list.
2020
*/
21-
string getSourceFunctionName() {
22-
result = sourceFunction().splitAt(",").trim()
23-
}
21+
string getSourceFunctionName() { result = sourceFunction().splitAt(",").trim() }
2422

2523
/**
2624
* Gets a method by matching against the selected source method names.
@@ -41,10 +39,7 @@ where
4139
source = getSourceFunction()
4240
or
4341
// Fallback for unit tests: include test files
44-
(
45-
not exists(getSourceFunction()) and
46-
source.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
47-
)
42+
not exists(getSourceFunction()) and
43+
source.getFile().getParentContainer().getParentContainer().getBaseName() = "test"
4844
)
49-
select call,
50-
"Call from `" + source.getName() + "` to `" + callee.getName() + "`"
45+
select call, "Call from `" + source.getName() + "` to `" + callee.getName() + "`"

0 commit comments

Comments
 (0)