codeql-development-mcp-server 2.24.2-rc2 → 2.24.2

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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/ql/actions/tools/src/PrintAST/PrintAST.md +53 -0
  3. package/ql/actions/tools/src/PrintCFG/PrintCFG.md +3 -3
  4. package/ql/actions/tools/src/codeql-pack.yml +1 -1
  5. package/ql/cpp/tools/src/CallGraphFrom/CallGraphFrom.md +44 -0
  6. package/ql/cpp/tools/src/CallGraphTo/CallGraphTo.md +41 -0
  7. package/ql/cpp/tools/src/PrintAST/PrintAST.md +58 -0
  8. package/ql/cpp/tools/src/PrintCFG/PrintCFG.md +2 -2
  9. package/ql/cpp/tools/src/codeql-pack.yml +1 -1
  10. package/ql/csharp/tools/src/CallGraphFrom/CallGraphFrom.md +44 -0
  11. package/ql/csharp/tools/src/CallGraphTo/CallGraphTo.md +41 -0
  12. package/ql/csharp/tools/src/PrintAST/PrintAST.md +56 -0
  13. package/ql/csharp/tools/src/PrintCFG/PrintCFG.md +2 -2
  14. package/ql/csharp/tools/src/codeql-pack.yml +1 -1
  15. package/ql/go/tools/src/CallGraphFrom/CallGraphFrom.md +44 -0
  16. package/ql/go/tools/src/CallGraphTo/CallGraphTo.md +41 -0
  17. package/ql/go/tools/src/PrintAST/PrintAST.md +55 -0
  18. package/ql/go/tools/src/PrintCFG/PrintCFG.md +2 -2
  19. package/ql/go/tools/src/codeql-pack.yml +1 -1
  20. package/ql/java/tools/src/CallGraphFrom/CallGraphFrom.md +44 -0
  21. package/ql/java/tools/src/CallGraphTo/CallGraphTo.md +41 -0
  22. package/ql/java/tools/src/PrintAST/PrintAST.md +54 -0
  23. package/ql/java/tools/src/PrintCFG/PrintCFG.md +2 -2
  24. package/ql/java/tools/src/codeql-pack.yml +1 -1
  25. package/ql/javascript/tools/src/CallGraphFrom/CallGraphFrom.md +47 -0
  26. package/ql/javascript/tools/src/CallGraphTo/CallGraphTo.md +45 -0
  27. package/ql/javascript/tools/src/PrintAST/PrintAST.md +58 -0
  28. package/ql/javascript/tools/src/PrintCFG/PrintCFG.md +2 -2
  29. package/ql/javascript/tools/src/codeql-pack.yml +1 -1
  30. package/ql/python/tools/src/CallGraphFrom/CallGraphFrom.md +46 -0
  31. package/ql/python/tools/src/CallGraphTo/CallGraphTo.md +45 -0
  32. package/ql/python/tools/src/PrintAST/PrintAST.md +53 -0
  33. package/ql/python/tools/src/PrintCFG/PrintCFG.md +2 -2
  34. package/ql/python/tools/src/codeql-pack.yml +1 -1
  35. package/ql/ruby/tools/src/CallGraphFrom/CallGraphFrom.md +48 -0
  36. package/ql/ruby/tools/src/CallGraphTo/CallGraphTo.md +47 -0
  37. package/ql/ruby/tools/src/PrintAST/PrintAST.md +56 -0
  38. package/ql/ruby/tools/src/PrintCFG/PrintCFG.md +2 -2
  39. package/ql/ruby/tools/src/codeql-pack.yml +1 -1
  40. package/ql/swift/tools/src/CallGraphFrom/CallGraphFrom.md +44 -0
  41. package/ql/swift/tools/src/CallGraphTo/CallGraphTo.md +41 -0
  42. package/ql/swift/tools/src/PrintAST/PrintAST.md +54 -0
  43. package/ql/swift/tools/src/PrintCFG/PrintCFG.md +55 -0
  44. package/ql/swift/tools/src/codeql-pack.yml +1 -1
@@ -0,0 +1,44 @@
1
+ # CallGraphFrom for Swift
2
+
3
+ Displays calls made from a specified function, showing the call graph outbound from the source function.
4
+
5
+ ## Overview
6
+
7
+ This query identifies all function calls made within the body of a named function, producing an outbound call graph. Given a source function name, it reports each call site and the callee, which is useful for understanding function dependencies and call chains.
8
+
9
+ The query accepts function names via an external predicate (`sourceFunction`).
10
+
11
+ ## Use Cases
12
+
13
+ This query is primarily used for:
14
+
15
+ - Mapping outbound dependencies of a specific function
16
+ - Understanding what a function calls and in what order
17
+ - Analyzing call chains for refactoring or security review
18
+
19
+ ## Example
20
+
21
+ The following Swift code demonstrates outbound calls from `sourceFunc`:
22
+
23
+ ```swift
24
+ func helper1() {}
25
+ func helper2() { helper1() }
26
+
27
+ func sourceFunc() { // Source function for analysis
28
+ helper1()
29
+ helper2()
30
+ }
31
+ ```
32
+
33
+ Running with `sourceFunction = "sourceFunc"` produces results showing each call site with the message pattern ``Call from `sourceFunc` to `helper1``.
34
+
35
+ ## Output Format
36
+
37
+ The query is a `@kind problem` query producing rows of:
38
+
39
+ - ``select call, "Call from `source` to `callee`"``
40
+
41
+ ## References
42
+
43
+ - [Swift Functions](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/)
44
+ - [CodeQL Call Graph Analysis](https://codeql.github.com/docs/writing-codeql-queries/about-data-flow-analysis/)
@@ -0,0 +1,41 @@
1
+ # CallGraphTo for Swift
2
+
3
+ Displays calls made to a specified function, showing the call graph inbound to the target function.
4
+
5
+ ## Overview
6
+
7
+ This query identifies all call sites that invoke a named function, producing an inbound call graph. Given a target function name, it reports each caller and call location, which is useful for understanding how a function is used across the codebase.
8
+
9
+ The query accepts function names via an external predicate (`targetFunction`).
10
+
11
+ ## Use Cases
12
+
13
+ This query is primarily used for:
14
+
15
+ - Finding all callers of a specific function
16
+ - Impact analysis before modifying a function signature
17
+ - Understanding usage patterns and entry points
18
+
19
+ ## Example
20
+
21
+ The following Swift code demonstrates inbound calls to `targetFunc`:
22
+
23
+ ```swift
24
+ func targetFunc() {} // Target function for analysis
25
+
26
+ func caller1() { targetFunc() }
27
+ func caller2() { targetFunc() }
28
+ ```
29
+
30
+ Running with `targetFunction = "targetFunc"` produces results showing each call site with the message pattern ``Call to `targetFunc` from `caller1``.
31
+
32
+ ## Output Format
33
+
34
+ The query is a `@kind problem` query producing rows of:
35
+
36
+ - ``select call, "Call to `target` from `caller`"``
37
+
38
+ ## References
39
+
40
+ - [Swift Functions](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/functions/)
41
+ - [CodeQL Call Graph Analysis](https://codeql.github.com/docs/writing-codeql-queries/about-data-flow-analysis/)
@@ -0,0 +1,54 @@
1
+ # Print AST for Swift
2
+
3
+ Outputs a representation of the Abstract Syntax Tree (AST) for specified source files.
4
+
5
+ ## Overview
6
+
7
+ The Abstract Syntax Tree is a hierarchical representation of source code structure. Each node represents a syntactic construct (declaration, statement, expression, etc.) and edges represent parent-child containment relationships.
8
+
9
+ This query produces the full AST for specified Swift source files, which is useful for understanding code structure, inspecting how the CodeQL extractor parses types and functions, and debugging query logic that operates on AST nodes.
10
+
11
+ ## Use Cases
12
+
13
+ This query is primarily used for:
14
+
15
+ - Inspecting how CodeQL represents Swift structs, classes, and functions
16
+ - Debugging queries that match on AST node types
17
+ - Understanding parent-child relationships between declarations and expressions
18
+ - Verifying extractor behavior for closures, optionals, and protocol conformances
19
+ - IDE integration for syntax tree visualization
20
+
21
+ ## Example
22
+
23
+ The following Swift code demonstrates AST structure through struct and function declarations:
24
+
25
+ ```swift
26
+ struct Example {
27
+ let name: String
28
+
29
+ func greet() { // Function declaration in AST
30
+ print("Hello, \(name)!")
31
+ }
32
+ }
33
+
34
+ let e = Example(name: "World") // Initializer call in AST
35
+ e.greet()
36
+ ```
37
+
38
+ In the resulting AST:
39
+
40
+ - The struct declaration contains property and function declarations as children
41
+ - Each function body contains a brace statement with expression nodes
42
+ - Call expressions and string interpolations reference their components as child nodes
43
+
44
+ ## Output Format
45
+
46
+ The query produces a graph via the `PrintAstConfiguration` library:
47
+
48
+ - `nodes`: Each AST node with its type, label, and properties
49
+ - `edges`: Parent-child relationships forming the syntax tree
50
+
51
+ ## References
52
+
53
+ - [Swift Language Guide](https://docs.swift.org/swift-book/)
54
+ - [CodeQL Abstract Syntax Trees](https://codeql.github.com/docs/writing-codeql-queries/abstract-syntax-tree/)
@@ -0,0 +1,55 @@
1
+ # Print CFG for Swift
2
+
3
+ Produces a representation of a file's Control Flow Graph (CFG) for specified source files.
4
+
5
+ ## Overview
6
+
7
+ The Control Flow Graph represents the order in which statements and expressions are executed in a program. Each node in the graph represents a control-flow element (statement or expression), and edges represent possible execution paths between them.
8
+
9
+ This query outputs all CFG nodes and their successor relationships for Swift code, which is useful for understanding program execution flow, debugging control flow issues, and analyzing code paths.
10
+
11
+ ## Use Cases
12
+
13
+ This query is primarily used for:
14
+
15
+ - Visualizing program execution flow
16
+ - Understanding complex branching logic
17
+ - Debugging control flow issues
18
+ - Analysis of code paths and reachability
19
+ - IDE integration for control flow visualization
20
+
21
+ ## Example
22
+
23
+ The following Swift code demonstrates control flow through conditional statements and loops:
24
+
25
+ ```swift
26
+ func example(x: Int) {
27
+ if x > 0 { // Branching creates CFG edges
28
+ print("Positive")
29
+ } else {
30
+ print("Non-positive")
31
+ }
32
+
33
+ for i in 0..<3 { // Loop creates cyclic CFG
34
+ print(i)
35
+ }
36
+ }
37
+ ```
38
+
39
+ In the resulting CFG:
40
+
41
+ - The `if` condition creates two outgoing edges (true/false branches)
42
+ - The `for-in` loop creates a cycle back to the iterator
43
+ - Each statement connects to its successor in execution order
44
+
45
+ ## Output Format
46
+
47
+ The query produces two relations:
48
+
49
+ - `nodes(ControlFlowNode, string, string)`: Each CFG node with its label
50
+ - `edges(ControlFlowNode, ControlFlowNode)`: Successor relationships between nodes
51
+
52
+ ## References
53
+
54
+ - [Swift Control Flow](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/controlflow/)
55
+ - [CodeQL Control Flow Graph](https://codeql.github.com/docs/writing-codeql-queries/about-control-flow-in-codeql/)
@@ -1,5 +1,5 @@
1
1
  name: advanced-security/ql-mcp-swift-tools-src
2
- version: 2.24.2-rc2
2
+ version: 2.24.2
3
3
  description: 'Queries for codeql-development-mcp-server tools for swift language'
4
4
  library: false
5
5
  dependencies: