Skip to main content

semantic/diff/
diff_options.rs

1// SPDX-License-Identifier: Apache-2.0
2//! Semantic diff options.
3
4use super::diff_types::SemanticBudget;
5use crate::analysis::SimilarityMethod;
6
7/// Options for semantic diff analysis.
8#[derive(Clone, Debug)]
9pub struct SemanticDiffOptions {
10    /// Similarity threshold for detecting renames (0.0 to 1.0).
11    pub rename_threshold: f64,
12    /// Method for computing similarity.
13    pub similarity_method: SimilarityMethod,
14    /// Whether to analyze function-level changes.
15    pub analyze_functions: bool,
16    /// Whether to detect import/dependency changes.
17    pub analyze_dependencies: bool,
18    /// Resource limits for semantic analysis.
19    pub budget: SemanticBudget,
20}
21
22impl Default for SemanticDiffOptions {
23    fn default() -> Self {
24        Self {
25            rename_threshold: 0.6,
26            similarity_method: SimilarityMethod::Lines,
27            analyze_functions: true,
28            analyze_dependencies: true,
29            budget: SemanticBudget::default(),
30        }
31    }
32}