Module query

Source
Expand description

Query framework and built-in queries over the knowledge graph.

This module defines the Query trait and a collection of ready-to-use queries such as ConnectedFilesQuery, FunctionUsageQuery, CycleDetectionQuery, ShortestPathQuery, HubsQuery, ModuleCentralityQuery, TraitImplsQuery, and UnreferencedItemsQuery.

Each query operates on crate::graph::KnowledgeGraph and returns results suitable for CLI or library consumption.

Structs§

ConnectedFilesQuery
Return the set of files directly connected to a target file by any relationship involving items defined in that file (edge endpoints at item-level are projected to file-level).
CycleDetectionQuery
Detect cycles over the file-level projection of the graph.
FunctionUsageQuery
Find callers or callees for a given function name, returning unique file paths.
HubsQuery
Compute top-N files by degree centrality.
ItemInfoQuery
ItemInfoRelationEntry
ItemInfoResult
ModuleCentralityQuery
Compute top-N modules (by directory) by degree centrality.
ShortestPathQuery
Compute shortest path between two files (directed edges) on the file-level projection.
TraitImplsQuery
List types implementing a given trait name.
UnreferencedItemsQuery
Find items without inbound Uses/Calls edges.

Enums§

CentralityMetric
Metric for degree centrality used by HubsQuery and ModuleCentralityQuery.
UsageDirection
Direction for FunctionUsageQuery.

Traits§

Query
Query trait implemented by all query types.