pub struct FunctionInfo {Show 23 fields
pub name: String,
pub start_line: usize,
pub end_line: usize,
pub name_col: usize,
pub name_end_col: 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<TypeRef>,
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,
pub return_type: Option<TypeRef>,
}Expand description
Extracted function info from AST.
Fields§
§name: String§start_line: usize§end_line: usize§name_col: usize0-based column of the function name identifier.
name_end_col: usize0-based end column of the function name identifier.
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<TypeRef>Parameter types in declaration order, each resolved to a TypeRef. Preserves position (first param = index 0) so positional analyses work.
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.
return_type: Option<TypeRef>Declared return type (None if not annotated or inferred), resolved the same way as parameter types. Drives return_type_leak detection.
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 moreSource§impl Debug for FunctionInfo
impl Debug for FunctionInfo
Source§impl Default for FunctionInfo
impl Default for FunctionInfo
Source§fn default() -> FunctionInfo
fn default() -> FunctionInfo
Source§impl<'de> Deserialize<'de> for FunctionInfo
impl<'de> Deserialize<'de> for FunctionInfo
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FunctionInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FunctionInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for FunctionInfo
impl Serialize for FunctionInfo
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto 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