bridge_centrality
Identifies hub modules in a codebase by counting unique module interactions, ranking them by connectivity score to reveal orchestrators with complex coupling.
Instructions
Compute module connectivity: how many unique modules each module interacts with.
For well-modularized codebases, identifies orchestrator and hub modules that touch many other modules. Replaces betweenness centrality (which is meaningless when inter-module edges are zero).
Connectivity score = (unique modules called + unique modules calling this) / 30 + frequency / 50 Higher score = more complex coupling with other modules.
Scores are persisted to the centrality_scores table under the
module_connectivity metric for use by framework_nodes().
:param top: Number of top connectivity modules to return (default 20). :param include_imports: Whether to include IMPORTS in connectivity (default True). :return: Markdown-formatted ranking table of modules by connectivity.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | ||
| include_imports | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |