pub struct FunctionInfo {Show 20 fields
pub name: String,
pub start_line: usize,
pub end_line: usize,
pub line_count: usize,
pub complexity: usize,
pub body_hash: Option<u64>,
pub is_exported: bool,
pub parameter_count: usize,
pub external_refs: Vec<String>,
pub chain_depth: usize,
pub switch_arms: usize,
pub is_delegating: bool,
pub parameter_types: Vec<String>,
pub comment_lines: usize,
pub referenced_fields: Vec<String>,
pub null_check_fields: Vec<String>,
pub switch_dispatch_target: Option<String>,
pub optional_param_count: usize,
pub called_functions: Vec<String>,
pub cognitive_complexity: usize,
}Expand description
Extracted function info from AST.
Fields§
§name: String§start_line: usize§end_line: usize§line_count: usize§complexity: usizeCyclomatic complexity (1 + number of branch points).
body_hash: Option<u64>Hash of the function body AST structure for duplicate detection.
is_exported: boolWhether this function is exported (pub/export).
parameter_count: usizeNumber of parameters.
external_refs: Vec<String>Names of external identifiers referenced in the body (for Feature Envy).
chain_depth: usizeMax method chain depth in the body (for Message Chains).
switch_arms: usizeNumber of switch/match arms (for Switch Statements).
is_delegating: boolWhether this function only delegates to another object’s method (for Middle Man).
parameter_types: Vec<String>Sorted parameter type names (for Data Clumps / Primitive Obsession).
comment_lines: usizeNumber of comment lines in the function body.
referenced_fields: Vec<String>Field names referenced in this function body (for Temporary Field).
null_check_fields: Vec<String>Field names checked for null/None in this function (for Null Object pattern).
switch_dispatch_target: Option<String>The field/variable name being dispatched on in switch/match (for Strategy/State).
optional_param_count: usizeNumber of optional parameters (for Builder pattern).
called_functions: Vec<String>Names of functions/methods called in this function body (for call graph).
cognitive_complexity: usizeCognitive complexity score [SonarSource 2017] — nesting-aware understandability metric.
Trait Implementations§
Source§impl Clone for FunctionInfo
impl Clone for FunctionInfo
Source§fn clone(&self) -> FunctionInfo
fn clone(&self) -> FunctionInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FunctionInfo
impl RefUnwindSafe for FunctionInfo
impl Send for FunctionInfo
impl Sync for FunctionInfo
impl Unpin for FunctionInfo
impl UnsafeUnpin for FunctionInfo
impl UnwindSafe for FunctionInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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,
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: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
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>
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>
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