rank_nodes
Identify the most structurally important code nodes by computing weighted CodeRank (PageRank) over the repository graph. Optionally persist scores for query-time reuse.
Instructions
Compute global weighted CodeRank (PageRank) over the repository graph.
Builds a directed weighted graph from the SQLite store and runs weighted PageRank to identify the most structurally important nodes. Relation weights follow the CodeRank defaults: CALLS=1.0, IMPORTS=0.9, INHERITS/CONFORMS/EXTENDS=0.75. Test paths are excluded by default.
Optionally persists the scores into the node_metrics table under the
given metric name so they can be loaded at query time without recomputing.
:param top: Number of top-ranked nodes to return (default 25).
:param rels: Comma-separated relations to include in the graph
(default "CALLS,IMPORTS,INHERITS,CONFORMS,EXTENDS").
:param persist_metric: If non-empty, persist scores to node_metrics
under this metric name (e.g. "coderank_global").
:param exclude_tests: Exclude test-path nodes from the graph (default True).
:return: JSON array of ranked node dicts with node_id, score,
top_pct (e.g. "top 0.5%"), kind, qualname,
module_path, and rank fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | ||
| rels | No | CALLS,IMPORTS,INHERITS,CONFORMS,EXTENDS | |
| exclude_tests | No | ||
| persist_metric | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |