pub struct DesignPatternAdvisor {
pub strategy_min_arms: usize,
pub state_min_arms: usize,
pub builder_min_params: usize,
pub builder_alt_min_params: usize,
pub builder_alt_min_optional: usize,
pub null_object_min_count: usize,
pub template_min_self_calls: usize,
pub template_min_methods: usize,
pub type_field_keywords: Vec<String>,
pub state_field_keywords: Vec<String>,
}Fields§
§strategy_min_arms: usize§state_min_arms: usize§builder_min_params: usize§builder_alt_min_params: usize§builder_alt_min_optional: usize§null_object_min_count: usize§template_min_self_calls: usize§template_min_methods: usize§type_field_keywords: Vec<String>§state_field_keywords: Vec<String>Trait Implementations§
Source§impl Default for DesignPatternAdvisor
impl Default for DesignPatternAdvisor
Source§impl Plugin for DesignPatternAdvisor
impl Plugin for DesignPatternAdvisor
Source§fn smells(&self) -> Vec<String>
fn smells(&self) -> Vec<String>
Smell names this plugin can produce.
Used by the host for smell-level filtering, docs, and
cha plugin list.
Default is empty — plugins should override to declare their smells.Source§fn description(&self) -> &str
fn description(&self) -> &str
Short description of what the plugin detects.
Source§fn analyze(&self, ctx: &AnalysisContext<'_>) -> Vec<Finding>
fn analyze(&self, ctx: &AnalysisContext<'_>) -> Vec<Finding>
Run analysis on a single file and return findings.
List of authors.
Source§fn try_fix(&self, finding: &Finding, ctx: &AnalysisContext<'_>) -> Option<Patch>
fn try_fix(&self, finding: &Finding, ctx: &AnalysisContext<'_>) -> Option<Patch>
Try to produce a Patch that fixes
finding. Returning None means
either no safe automatic fix exists or this plugin doesn’t own the
smell. Only one plugin produces edits per finding (registry order);
overlapping edits across plugins are undefined.Auto Trait Implementations§
impl Freeze for DesignPatternAdvisor
impl RefUnwindSafe for DesignPatternAdvisor
impl Send for DesignPatternAdvisor
impl Sync for DesignPatternAdvisor
impl Unpin for DesignPatternAdvisor
impl UnsafeUnpin for DesignPatternAdvisor
impl UnwindSafe for DesignPatternAdvisor
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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