pub struct AridNodeDetector { /* private fields */ }Expand description
Arid node detector implementing Google’s algorithm
Implementations§
Source§impl AridNodeDetector
impl AridNodeDetector
pub fn new() -> Result<Self>
Sourcepub fn is_arid(&mut self, node: &AstNode) -> bool
pub fn is_arid(&mut self, node: &AstNode) -> bool
Implementation of Google’s arid node detection algorithm arid(N) = expert(N) if simple(N) = 1 if ∀(arid(c)) = 1, ∀c ∈ N otherwise
Sourcepub fn should_mutate_line(
&mut self,
line_content: &str,
line_number: usize,
) -> bool
pub fn should_mutate_line( &mut self, line_content: &str, line_number: usize, ) -> bool
Check if a line should be mutated based on AST analysis
Sourcepub fn add_expert_rule(
&mut self,
pattern: &str,
description: &str,
) -> Result<()>
pub fn add_expert_rule( &mut self, pattern: &str, description: &str, ) -> Result<()>
Add a new expert rule at runtime
Sourcepub fn analyze_file_detailed(&mut self, file_content: &str) -> DetailedAnalysis
pub fn analyze_file_detailed(&mut self, file_content: &str) -> DetailedAnalysis
Export detailed analysis of which lines were filtered and why
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the cache (useful for testing or when rules change)
Auto Trait Implementations§
impl Freeze for AridNodeDetector
impl RefUnwindSafe for AridNodeDetector
impl Send for AridNodeDetector
impl Sync for AridNodeDetector
impl Unpin for AridNodeDetector
impl UnwindSafe for AridNodeDetector
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
Mutably borrows from an owned value. Read more