pub struct Pattern {
pub name: String,
pub edges: Vec<(u32, u32)>,
pub min_nodes: usize,
pub max_nodes: Option<usize>,
pub severity: Severity,
}Expand description
Pattern specification for matching
Fields§
§name: StringPattern name
edges: Vec<(u32, u32)>Pattern edges (source, target) - node IDs are local to the pattern
min_nodes: usizeMinimum number of nodes in the pattern
max_nodes: Option<usize>Maximum number of nodes (None = unbounded)
severity: SeveritySeverity if found
Implementations§
Source§impl Pattern
impl Pattern
Sourcepub fn new(name: String, edges: Vec<(u32, u32)>, severity: Severity) -> Pattern
pub fn new(name: String, edges: Vec<(u32, u32)>, severity: Severity) -> Pattern
Create a new pattern
Sourcepub fn god_class(min_callees: usize) -> Pattern
pub fn god_class(min_callees: usize) -> Pattern
Create a “God Class” pattern (node with many outgoing edges)
Detects functions that call too many other functions (high fan-out)
Sourcepub fn circular_dependency(cycle_length: usize) -> Pattern
pub fn circular_dependency(cycle_length: usize) -> Pattern
Create a “Circular Dependency” pattern (cycle of length N)
Detects function call cycles
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnsafeUnpin for Pattern
impl UnwindSafe for Pattern
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> 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