neural_shared/report/
mod.rs

1//! Report generation in various formats
2
3use crate::Result;
4use serde::Serialize;
5
6pub mod json;
7pub mod markdown;
8
9pub use json::JsonReporter;
10pub use markdown::MarkdownReporter;
11
12/// Trait for analysis findings that can be reported
13pub trait Finding: Serialize {
14    /// Get the kind/type of the finding (e.g., "Function", "Class")
15    fn kind(&self) -> String;
16    /// Get the name of the symbol
17    fn name(&self) -> String;
18    /// Get the file path
19    fn file(&self) -> String;
20    /// Get the line number
21    fn line(&self) -> usize;
22    /// Get the column number
23    fn column(&self) -> usize;
24    /// Get the reason/description
25    fn reason(&self) -> String;
26    /// Get the confidence level
27    fn confidence(&self) -> String;
28}
29
30/// Reporter trait for outputting analysis results
31pub trait Reporter<T: Finding> {
32    fn report(&self, findings: &[T]) -> Result<String>;
33}