pub struct Analytics { /* private fields */ }Expand description
DuckDB analytics engine for code intelligence.
Implementations§
Source§impl Analytics
impl Analytics
Sourcepub fn call_graph(
&self,
start_name: &str,
max_depth: i32,
) -> Result<Vec<CallGraphNode>>
pub fn call_graph( &self, start_name: &str, max_depth: i32, ) -> Result<Vec<CallGraphNode>>
Get the full call graph starting from a symbol (forward traversal).
The start_name can be:
- A simple name like “new” (matches first symbol with that name)
- A qualified name like “LocalProvider::new”
- A full ID like “src/embeddings/local.rs::LocalProvider::new@20”
Sourcepub fn impact_analysis(
&self,
target_name: &str,
max_depth: i32,
) -> Result<Vec<ImpactNode>>
pub fn impact_analysis( &self, target_name: &str, max_depth: i32, ) -> Result<Vec<ImpactNode>>
Impact analysis: find all symbols that would be affected by changing the target.
The target_name can be:
- A simple name like “new” (matches first symbol with that name)
- A qualified name like “LocalProvider::new”
- A full ID like “src/embeddings/local.rs::LocalProvider::new@20”
Sourcepub fn file_statistics(&self) -> Result<Vec<FileStats>>
pub fn file_statistics(&self) -> Result<Vec<FileStats>>
Get file statistics for all indexed files.
Sourcepub fn has_path(
&self,
from_name: &str,
to_name: &str,
max_depth: i32,
) -> Result<bool>
pub fn has_path( &self, from_name: &str, to_name: &str, max_depth: i32, ) -> Result<bool>
Find if a path exists between two symbols (simplified version).
Both from_name and to_name can be symbol IDs, qualified names, or simple names.
Sourcepub fn most_connected(
&self,
limit: i32,
) -> Result<Vec<(String, String, i64, i64)>>
pub fn most_connected( &self, limit: i32, ) -> Result<Vec<(String, String, i64, i64)>>
Get the most connected symbols (highest in/out degree).
This correctly counts incoming edges per symbol ID, not by name, avoiding over-counting for common names like “new”.
Sourcepub fn find_recursive_functions(&self) -> Result<Vec<(String, String)>>
pub fn find_recursive_functions(&self) -> Result<Vec<(String, String)>>
Check if there are any self-recursive functions.
Uses target_id when available for accurate recursion detection.
Sourcepub fn file_dependencies(&self) -> Result<Vec<(String, String, i64)>>
pub fn file_dependencies(&self) -> Result<Vec<(String, String, i64)>>
Get dependency graph between files (module-level).
Uses target_id when available for accurate file resolution.
Sourcepub fn complexity_analysis(
&self,
threshold: i64,
) -> Result<Vec<ComplexityResult>>
pub fn complexity_analysis( &self, threshold: i64, ) -> Result<Vec<ComplexityResult>>
Analyze code complexity based on fan-out (outgoing calls) and fan-in (incoming calls).
This correctly counts incoming edges per symbol ID, not by name, avoiding over-counting for common names like “new”.
Auto Trait Implementations§
impl !Freeze for Analytics
impl !RefUnwindSafe for Analytics
impl !Sync for Analytics
impl Send for Analytics
impl Unpin for Analytics
impl UnsafeUnpin for Analytics
impl UnwindSafe for Analytics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more