codeql-development-mcp-server 2.25.1 → 2.25.2-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/codeql-development-mcp-server.js +162304 -25548
- package/dist/codeql-development-mcp-server.js.map +4 -4
- package/package.json +16 -15
- package/ql/README.md +1 -0
- package/ql/actions/tools/src/codeql-pack.yml +1 -1
- package/ql/cpp/tools/src/codeql-pack.yml +1 -1
- package/ql/csharp/tools/src/codeql-pack.yml +1 -1
- package/ql/go/tools/src/codeql-pack.yml +1 -1
- package/ql/java/tools/src/codeql-pack.yml +1 -1
- package/ql/javascript/tools/src/codeql-pack.yml +1 -1
- package/ql/python/tools/src/codeql-pack.yml +1 -1
- package/ql/ruby/tools/src/codeql-pack.yml +1 -1
- package/ql/rust/tools/src/CallGraphFrom/CallGraphFrom.md +48 -0
- package/ql/rust/tools/src/CallGraphFrom/CallGraphFrom.ql +38 -0
- package/ql/rust/tools/src/CallGraphFromTo/CallGraphFromTo.md +48 -0
- package/ql/rust/tools/src/CallGraphFromTo/CallGraphFromTo.ql +69 -0
- package/ql/rust/tools/src/CallGraphTo/CallGraphTo.md +47 -0
- package/ql/rust/tools/src/CallGraphTo/CallGraphTo.ql +47 -0
- package/ql/rust/tools/src/ExternalPredicates.qll +14 -0
- package/ql/rust/tools/src/PrintAST/PrintAST.md +59 -0
- package/ql/rust/tools/src/PrintAST/PrintAST.ql +46 -0
- package/ql/rust/tools/src/PrintCFG/PrintCFG.md +56 -0
- package/ql/rust/tools/src/PrintCFG/PrintCFG.ql +58 -0
- package/ql/rust/tools/src/codeql-pack.lock.yml +28 -0
- package/ql/rust/tools/src/codeql-pack.yml +6 -0
- package/ql/swift/tools/src/codeql-pack.yml +1 -1
- package/scripts/setup-packs.sh +2 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name Print CFG for rust
|
|
3
|
+
* @description Produces a representation of a file's Control Flow Graph for specified source files.
|
|
4
|
+
* @id rust/tools/print-cfg
|
|
5
|
+
* @kind graph
|
|
6
|
+
* @tags cfg
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import rust
|
|
10
|
+
import codeql.rust.controlflow.ControlFlowGraph
|
|
11
|
+
import ExternalPredicates
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Gets a single source file from the comma-separated list.
|
|
15
|
+
*/
|
|
16
|
+
string getSelectedSourceFile() {
|
|
17
|
+
exists(string s | selectedSourceFiles(s) | result = s.splitAt(",").trim())
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Gets a file by matching against the selected source file paths.
|
|
22
|
+
*/
|
|
23
|
+
File getSelectedFile() {
|
|
24
|
+
exists(string selectedFile |
|
|
25
|
+
selectedFile = getSelectedSourceFile() and
|
|
26
|
+
(
|
|
27
|
+
// Match by exact relative path from source root
|
|
28
|
+
result.getRelativePath() = selectedFile
|
|
29
|
+
or
|
|
30
|
+
// Match by file name if no path separators
|
|
31
|
+
not selectedFile.matches("%/%") and result.getBaseName() = selectedFile
|
|
32
|
+
or
|
|
33
|
+
// Match by ending path component
|
|
34
|
+
result.getAbsolutePath().suffix(result.getAbsolutePath().length() - selectedFile.length()) =
|
|
35
|
+
selectedFile
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Holds if this CFG node should be included in output.
|
|
42
|
+
*/
|
|
43
|
+
predicate shouldPrintNode(CfgNode node) { node.getLocation().getFile() = getSelectedFile() }
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Configuration for PrintCFG that outputs filtered CFG nodes and edges.
|
|
47
|
+
*/
|
|
48
|
+
query predicate nodes(CfgNode node, string property, string value) {
|
|
49
|
+
shouldPrintNode(node) and
|
|
50
|
+
property = "semmle.label" and
|
|
51
|
+
value = node.toString()
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
query predicate edges(CfgNode pred, CfgNode succ) {
|
|
55
|
+
shouldPrintNode(pred) and
|
|
56
|
+
shouldPrintNode(succ) and
|
|
57
|
+
pred.getASuccessor() = succ
|
|
58
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
lockVersion: 1.0.0
|
|
3
|
+
dependencies:
|
|
4
|
+
codeql/concepts:
|
|
5
|
+
version: 0.0.20
|
|
6
|
+
codeql/controlflow:
|
|
7
|
+
version: 2.0.30
|
|
8
|
+
codeql/dataflow:
|
|
9
|
+
version: 2.1.2
|
|
10
|
+
codeql/mad:
|
|
11
|
+
version: 1.0.46
|
|
12
|
+
codeql/regex:
|
|
13
|
+
version: 1.0.46
|
|
14
|
+
codeql/rust-all:
|
|
15
|
+
version: 0.2.10
|
|
16
|
+
codeql/ssa:
|
|
17
|
+
version: 2.0.22
|
|
18
|
+
codeql/threat-models:
|
|
19
|
+
version: 1.0.46
|
|
20
|
+
codeql/tutorial:
|
|
21
|
+
version: 1.0.46
|
|
22
|
+
codeql/typeinference:
|
|
23
|
+
version: 0.0.27
|
|
24
|
+
codeql/typetracking:
|
|
25
|
+
version: 2.0.30
|
|
26
|
+
codeql/util:
|
|
27
|
+
version: 2.0.33
|
|
28
|
+
compiled: false
|
package/scripts/setup-packs.sh
CHANGED
|
@@ -31,7 +31,7 @@ Install CodeQL pack dependencies for bundled tool query packs.
|
|
|
31
31
|
|
|
32
32
|
OPTIONS:
|
|
33
33
|
--language <lang> Install packs only for the specified language
|
|
34
|
-
Valid values: actions, cpp, csharp, go, java, javascript, python, ruby, swift
|
|
34
|
+
Valid values: actions, cpp, csharp, go, java, javascript, python, ruby, rust, swift
|
|
35
35
|
-h, --help Show this help message
|
|
36
36
|
|
|
37
37
|
By default, installs pack dependencies for all supported languages.
|
|
@@ -62,7 +62,7 @@ while [[ $# -gt 0 ]]; do
|
|
|
62
62
|
done
|
|
63
63
|
|
|
64
64
|
## Validate language if provided
|
|
65
|
-
VALID_LANGUAGES=("actions" "cpp" "csharp" "go" "java" "javascript" "python" "ruby" "swift")
|
|
65
|
+
VALID_LANGUAGES=("actions" "cpp" "csharp" "go" "java" "javascript" "python" "ruby" "rust" "swift")
|
|
66
66
|
if [ -n "${LANGUAGE}" ]; then
|
|
67
67
|
LANGUAGE_VALID=false
|
|
68
68
|
for valid_lang in "${VALID_LANGUAGES[@]}"; do
|