pub struct FrameworkPatternDetector { /* private fields */ }Expand description
Detector for framework patterns
Implementations§
Source§impl FrameworkPatternDetector
impl FrameworkPatternDetector
Sourcepub fn with_config(config: PatternConfig) -> Self
pub fn with_config(config: PatternConfig) -> Self
Create a detector with custom configuration
Sourcepub fn analyze_file(&mut self, file_path: &Path, ast: &File) -> Result<()>
pub fn analyze_file(&mut self, file_path: &Path, ast: &File) -> Result<()>
Analyze a file for framework patterns
Sourcepub fn get_detected_patterns(&self) -> Vector<FrameworkPattern>
pub fn get_detected_patterns(&self) -> Vector<FrameworkPattern>
Get all detected patterns
Sourcepub fn might_be_framework_managed(&self, func_id: &FunctionId) -> bool
pub fn might_be_framework_managed(&self, func_id: &FunctionId) -> bool
Check if a function might be managed by a framework
Sourcepub fn get_function_patterns(
&self,
func_id: &FunctionId,
) -> Option<&Vector<PatternType>>
pub fn get_function_patterns( &self, func_id: &FunctionId, ) -> Option<&Vector<PatternType>>
Get pattern types for a specific function
Sourcepub fn get_functions_by_pattern(
&self,
pattern_type: &PatternType,
) -> Vector<FunctionId>
pub fn get_functions_by_pattern( &self, pattern_type: &PatternType, ) -> Vector<FunctionId>
Get functions of a specific pattern type
Sourcepub fn get_statistics(&self) -> PatternStatistics
pub fn get_statistics(&self) -> PatternStatistics
Get statistics about detected patterns
Sourcepub fn add_custom_pattern(
&mut self,
attribute_name: String,
description: String,
)
pub fn add_custom_pattern( &mut self, attribute_name: String, description: String, )
Add a custom pattern configuration
Sourcepub fn get_exclusions(&self) -> HashSet<FunctionId>
pub fn get_exclusions(&self) -> HashSet<FunctionId>
Get functions that should be excluded from dead code analysis
Sourcepub fn add_visit_trait_function(&mut self, func_id: FunctionId)
pub fn add_visit_trait_function(&mut self, func_id: FunctionId)
Mark a function as a Visit trait implementation
Sourcepub fn is_visitor_pattern_method(func_name: &str) -> bool
pub fn is_visitor_pattern_method(func_name: &str) -> bool
Check if a function is likely a visitor pattern method by name
Trait Implementations§
Source§impl Clone for FrameworkPatternDetector
impl Clone for FrameworkPatternDetector
Source§fn clone(&self) -> FrameworkPatternDetector
fn clone(&self) -> FrameworkPatternDetector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FrameworkPatternDetector
impl Debug for FrameworkPatternDetector
Auto Trait Implementations§
impl Freeze for FrameworkPatternDetector
impl RefUnwindSafe for FrameworkPatternDetector
impl Send for FrameworkPatternDetector
impl Sync for FrameworkPatternDetector
impl Unpin for FrameworkPatternDetector
impl UnsafeUnpin for FrameworkPatternDetector
impl UnwindSafe for FrameworkPatternDetector
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EnsureExt<T> for T
impl<T> EnsureExt<T> for T
Source§fn ensure<P, E>(self, predicate: P, error: E) -> Validation<T, NonEmptyVec<E>>where
P: Predicate<T>,
fn ensure<P, E>(self, predicate: P, error: E) -> Validation<T, NonEmptyVec<E>>where
P: Predicate<T>,
Validate that this value satisfies the given predicate. Read more
Source§fn ensure_with<P, E, F>(
self,
predicate: P,
error_fn: F,
) -> Validation<T, NonEmptyVec<E>>
fn ensure_with<P, E, F>( self, predicate: P, error_fn: F, ) -> Validation<T, NonEmptyVec<E>>
Validate with an error-generating function. Read more
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>
Converts
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>
Converts
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