#[non_exhaustive]pub struct StaticFunction {
pub name: String,
pub start_line: u32,
pub end_line: u32,
pub cyclomatic: u32,
pub static_used: bool,
pub test_covered: bool,
pub caller_count: u32,
pub owner_count: Option<u32>,
pub identity: Option<FunctionIdentity>,
}Expand description
Static analysis results for a single function within a StaticFile.
Marked #[non_exhaustive] in 0.6.0: downstream Rust consumers must
stop using struct-literal construction at the type’s boundary
(destructure-with-.. for reads still works). No Default impl
ships on this type. See CHANGELOG for the migration note. The wire
shape is unchanged.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringFunction identifier as reported by the static analyzer. May be an
anonymous placeholder (e.g. "<anonymous>") when the source has no
name at the definition site.
start_line: u321-indexed line where the function body starts.
end_line: u321-indexed line where the function body ends (inclusive).
cyclomatic: u32Cyclomatic complexity of the function, as computed by the CLI.
static_used: boolWhether this function is statically referenced by the module graph.
Drives Evidence::static_status and gates Verdict::SafeToDelete.
Required: a missing field would silently default to “used” and hide
every safe_to_delete finding.
test_covered: boolWhether this function is covered by the project’s test suite.
Drives Evidence::test_coverage. Required for the same reason as
StaticFunction::static_used.
caller_count: u32Static caller count supplied by the CLI’s module graph. Added in 0.4.0 for first-class blast-radius output; defaults to zero for older CLIs.
owner_count: Option<u32>CODEOWNERS owner count for the containing file. None means no
CODEOWNERS data was available; Some(0) means CODEOWNERS exists but
no rule matched this file. Added in 0.4.0 for importance scoring.
identity: Option<FunctionIdentity>Canonical function identity introduced in 0.6.0. When present,
consumers SHOULD prefer FunctionIdentity::stable_id as the
cross-surface join key over the legacy (file, name, start_line)
triple. Optional for forward-compat with 0.5-shape CLIs.
Trait Implementations§
Source§impl Clone for StaticFunction
impl Clone for StaticFunction
Source§fn clone(&self) -> StaticFunction
fn clone(&self) -> StaticFunction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more