Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

style: clang-format issue-batch additions (cypher/mcp)

Martin Vogel781456818fe5
diff --git a/src/cypher/cypher.c b/src/cypher/cypher.c
index 907e9c084..77bc7105a 100644
--- a/src/cypher/cypher.c
+++ b/src/cypher/cypher.c
@@ -4228,14 +4228,16 @@ static void cross_join_with_rels(cbm_store_t *store, cbm_pattern_t *patn, bindin
* Instead we scan only the bound terminal's edges and bind `c` to real
* neighbours; with OPTIONAL we keep the row with `c` unbound when there are
* none — the correct dead-code semantics. */
-static void expand_from_bound_terminal(cbm_store_t *store, cbm_pattern_t *patn, binding_t **bindings,
- int *bind_count, const char *start_var, bool opt) {
+static void expand_from_bound_terminal(cbm_store_t *store, cbm_pattern_t *patn,
+ binding_t **bindings, int *bind_count, const char *start_var,
+ bool opt) {
cbm_rel_pattern_t *rel = &patn->rels[0];
const cbm_node_pattern_t *start_node = &patn->nodes[0];
/* The relationship is written start-[r]->terminal. To enumerate the start
* nodes reachable from the bound terminal we invert the stored direction. */
bool rel_inbound = rel->direction && strcmp(rel->direction, "inbound") == 0;
- bool scan_targets = !rel_inbound; /* (start)->(term): start = edge source = scan term's inbound */
+ bool scan_targets =
+ !rel_inbound; /* (start)->(term): start = edge source = scan term's inbound */
size_t alloc_n = (size_t)*bind_count * (size_t)CYP_GROWTH_10 + SKIP_ONE;
binding_t *new_bindings = malloc(alloc_n * sizeof(binding_t));
@@ -4250,8 +4252,8 @@ static void expand_from_bound_terminal(cbm_store_t *store, cbm_pattern_t *patn,
cbm_node_t *term = binding_get(b, patn->nodes[1].variable ? patn->nodes[1].variable : "");
int match_count = 0;
if (term) {
- for (int ti = 0; ti < (rel->type_count > 0 ? rel->type_count : 1) && new_count < max_new;
- ti++) {
+ for (int ti = 0;
+ ti < (rel->type_count > 0 ? rel->type_count : 1) && new_count < max_new; ti++) {
cbm_edge_t *edges = NULL;
int edge_count = 0;
if (rel->type_count > 0) {
diff --git a/src/mcp/mcp.c b/src/mcp/mcp.c
index a6eef0e9e..e146e9d20 100644
--- a/src/mcp/mcp.c
+++ b/src/mcp/mcp.c
@@ -2606,19 +2606,19 @@ static char *handle_trace_call_path(cbm_mcp_server_t *srv, const char *args) {
(void)sel; /* union across all same-name nodes — see bfs_union_same_name (#546) */
if (do_outbound) {
- bfs_union_same_name(store, nodes, node_count, "outbound", edge_types, edge_type_count, depth,
- &tr_out);
- yyjson_mut_obj_add_val(doc, root, "callees",
- bfs_to_json_array(doc, &tr_out, risk_labels, include_tests,
- data_flow));
+ bfs_union_same_name(store, nodes, node_count, "outbound", edge_types, edge_type_count,
+ depth, &tr_out);
+ yyjson_mut_obj_add_val(
+ doc, root, "callees",
+ bfs_to_json_array(doc, &tr_out, risk_labels, include_tests, data_flow));
}
if (do_inbound) {
bfs_union_same_name(store, nodes, node_count, "inbound", edge_types, edge_type_count, depth,
&tr_in);
- yyjson_mut_obj_add_val(doc, root, "callers",
- bfs_to_json_array(doc, &tr_in, risk_labels, include_tests,
- data_flow));
+ yyjson_mut_obj_add_val(
+ doc, root, "callers",
+ bfs_to_json_array(doc, &tr_in, risk_labels, include_tests, data_flow));
}
/* Serialize BEFORE freeing traversal results (yyjson borrows strings) */
@@ -4420,8 +4420,8 @@ static char *handle_detect_changes(cbm_mcp_server_t *srv, const char *args) {
* prefix when present so all three sources yield clean paths; for a
* rename ("R old -> new") keep the post-arrow destination path. */
char *path_line = line;
- if (len > PAIR_LEN && line[PAIR_LEN] == ' ' &&
- strchr(" MADRCU?!", line[0]) && strchr(" MADRCU?!", line[1])) {
+ if (len > PAIR_LEN && line[PAIR_LEN] == ' ' && strchr(" MADRCU?!", line[0]) &&
+ strchr(" MADRCU?!", line[1])) {
path_line = line + PAIR_LEN + SKIP_ONE;
char *arrow = strstr(path_line, " -> ");
if (arrow) {