pub struct DeadCodeConfig {
pub min_confidence: f64,
pub extra_entry_patterns: Vec<String>,
pub filter_patterns: Vec<String>,
pub language: Option<String>,
pub include_public_api_patterns: bool,
}Expand description
Configuration for dead code detection.
Fields§
§min_confidence: f64Minimum confidence threshold for reporting (0.0 - 1.0)
extra_entry_patterns: Vec<String>Additional entry point patterns (regex-like simple patterns)
filter_patterns: Vec<String>Additional false positive patterns to filter
language: Option<String>Language-specific mode (enables language-specific heuristics)
include_public_api_patterns: boolInclude functions matching public API patterns (get_, set_, PascalCase, etc.) as entry points.
WARNING: This is EXTREMELY permissive and causes massive false negatives!
The is_likely_public_api() function matches 50-70% of functions because it includes:
- Any function starting with uppercase (PascalCase) - matches most Java/Go/Rust functions
- get_/set_ prefixed functions
- is_/has_/can_/should_ prefixed functions
- with_/from_/to_/as_ prefixed functions
Default: false (matches Python brrr dead behavior which only checks specific patterns)
Only enable this if you want to be extremely conservative and avoid false positives, at the cost of missing most actual dead code.
Trait Implementations§
Source§impl Clone for DeadCodeConfig
impl Clone for DeadCodeConfig
Source§fn clone(&self) -> DeadCodeConfig
fn clone(&self) -> DeadCodeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeadCodeConfig
impl Debug for DeadCodeConfig
Auto Trait Implementations§
impl Freeze for DeadCodeConfig
impl RefUnwindSafe for DeadCodeConfig
impl Send for DeadCodeConfig
impl Sync for DeadCodeConfig
impl Unpin for DeadCodeConfig
impl UnwindSafe for DeadCodeConfig
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request