search_graph reported in_degree/out_degree of 0 for Class nodes that
have real INHERITS edges, because the degree computation in both
cbm_store_node_degree (Cypher virtual properties) and cbm_store_search
(result population and min_degree/max_degree filter) only counted CALLS
(and USAGE) edges. A min_degree filter therefore silently excluded
well-connected classes.
Broaden the edge-type predicate in both surfaces to
IN ('CALLS', 'USAGE', 'INHERITS', 'IMPLEMENTS') so search_graph and
Cypher report the same edge-type-agnostic degree and stay consistent.
Add regression tests covering: a parent class with N INHERITS children,
combined CALLS+INHERITS degree without double counting, min_degree now
including inheritance-only classes, and isolated nodes still reporting
zero.
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
What does this PR do?
Fixes #558. search_graph reported in_degree: 0 / out_degree: 0 for Class nodes that have real INHERITS edges (e.g. a parent class with 8 subclasses showed in_degree: 0), so any min_degree filter silently excluded well-connected classes.
The degree shown by search_graph is computed on demand in cbm_store_search, where the in_deg/out_deg subqueries only counted e.type IN ('CALLS', 'USAGE'), omitting structural edges. This PR broadens that predicate to IN ('CALLS', 'USAGE', 'INHERITS', 'IMPLEMENTS') so the surfaced degree and the min_degree/max_degree filter reflect inheritance edges.
cbm_store_node_degree is left untouched on purpose: it backs the get_code_snippet callers/callees counts and the Cypher in_degree/out_degree virtual property, both of which are deliberately CALLS-scoped. Broadening it there would inflate call counts, so the fix is scoped to the search_graph surface that the issue is about.
Tests
Added four regression tests to tests/test_store_search.c:
The pre-existing store_node_degree test (which asserts cbm_store_node_degree stays CALLS-only) continues to pass, confirming the caller/callee semantics are unchanged.
Checklist