Skip to main content

Analyzer

Trait Analyzer 

Source
pub trait Analyzer: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn name(&self) -> &str;
    fn categories(&self) -> &[&str];
    fn analyze(
        &self,
        project: &Path,
        files: &[PathBuf],
        context: &AnalysisContext,
    ) -> Vec<Finding>;
}
Expand description

Trait for pluggable assessment analyzers.

Implement this trait to add a new analyzer to the assessment pipeline. Each analyzer receives the project root, the list of scoped files, and an AnalysisContext, and returns zero or more Finding values.

Required Methods§

Source

fn id(&self) -> &str

Unique identifier for the analyzer (e.g. “complexity”).

Source

fn name(&self) -> &str

Human-readable display name.

Source

fn categories(&self) -> &[&str]

Categories of findings this analyzer may produce.

Source

fn analyze( &self, project: &Path, files: &[PathBuf], context: &AnalysisContext, ) -> Vec<Finding>

Run analysis over the given files and return findings.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§