Complexity, signal flow and project statistics
godot_metricsMeasure Godot project complexity, signal wiring, and asset/script stats offline to identify functions to split and broken signal connections before editing.
Instructions
Three measurements from the project's files, offline. op complexity: cyclomatic complexity per function (1 plus every if, elif, for, while, match arm, and, or, ternary) with a grade A to F, lines and nesting; the functions above threshold (default 10) worst first, and the project average. Use it to pick what to split before you change it. op signals: every signal with who emits it and who connects to it (scenes and code), and three lists that are bugs: declared but never emitted, emitted but never connected, and a connection to a method that does not exist; mermaid: true draws the flow. op stats: counts of scripts, scenes, resources and assets, lines of code, comment and blank, how much is typed, the biggest scripts, and the heaviest scenes (nodes, depth, scripts, instances, sub-resources).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"op": "<op>"
},
"name": "godot_metrics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | what to measure | |
| path | No | project folder, or a file or folder inside it (relative to the server's folder; default: the current project) | |
| limit | No | how many entries to list | |
| mermaid | No | signals: return a mermaid flowchart instead of the lists | |
| threshold | No | complexity: list functions above this (default 10) |