pub struct VolatilityAnalyzer {
pub file_changes: HashMap<String, usize>,
pub period_months: usize,
}Expand description
Volatility analyzer using git history
Fields§
§file_changes: HashMap<String, usize>File path -> change count
period_months: usizeAnalysis period in months
Implementations§
Source§impl VolatilityAnalyzer
impl VolatilityAnalyzer
Sourcepub fn analyze(&mut self, repo_path: &Path) -> Result<(), VolatilityError>
pub fn analyze(&mut self, repo_path: &Path) -> Result<(), VolatilityError>
Analyze git history for a repository (optimized version)
Optimizations applied:
- Use
-- "*.rs"to filter .rs files at git level - Use streaming with BufReader instead of loading all into memory
- Use
--diff-filter=AMRCto skip deleted files
Sourcepub fn get_volatility(&self, file_path: &str) -> Volatility
pub fn get_volatility(&self, file_path: &str) -> Volatility
Get volatility level for a file
Sourcepub fn get_change_count(&self, file_path: &str) -> usize
pub fn get_change_count(&self, file_path: &str) -> usize
Get change count for a file
Sourcepub fn high_volatility_files(&self) -> Vec<(&String, usize)>
pub fn high_volatility_files(&self) -> Vec<(&String, usize)>
Get all high volatility files
Sourcepub fn statistics(&self) -> VolatilityStats
pub fn statistics(&self) -> VolatilityStats
Get volatility statistics
Trait Implementations§
Source§impl Debug for VolatilityAnalyzer
impl Debug for VolatilityAnalyzer
Source§impl Default for VolatilityAnalyzer
impl Default for VolatilityAnalyzer
Source§fn default() -> VolatilityAnalyzer
fn default() -> VolatilityAnalyzer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VolatilityAnalyzer
impl RefUnwindSafe for VolatilityAnalyzer
impl Send for VolatilityAnalyzer
impl Sync for VolatilityAnalyzer
impl Unpin for VolatilityAnalyzer
impl UnwindSafe for VolatilityAnalyzer
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> 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 more