pub struct DuplicatesConfig {Show 13 fields
pub enabled: bool,
pub mode: DetectionMode,
pub min_tokens: usize,
pub min_lines: usize,
pub threshold: f64,
pub ignore: Vec<String>,
pub ignore_defaults: bool,
pub skip_local: bool,
pub cross_language: bool,
pub ignore_imports: bool,
pub normalization: NormalizationConfig,
pub min_corpus_size_for_shingle_filter: usize,
pub min_corpus_size_for_token_cache: usize,
}Expand description
Configuration for code duplication detection.
Fields§
§enabled: boolWhether duplication detection is enabled.
mode: DetectionModeDetection mode: strict, mild, weak, or semantic.
min_tokens: usizeMinimum number of tokens for a clone.
min_lines: usizeMinimum number of lines for a clone.
threshold: f64Maximum allowed duplication percentage (0 = no limit).
ignore: Vec<String>Additional ignore patterns for duplication analysis.
ignore_defaults: boolMerge built-in generated-framework ignore patterns with ignore.
Set to false to use only the user-provided ignore list.
skip_local: boolOnly report cross-directory duplicates.
cross_language: boolEnable cross-language clone detection by stripping type annotations.
When enabled, TypeScript type annotations (parameter types, return types,
generics, interfaces, type aliases) are stripped from the token stream,
allowing detection of clones between .ts and .js files.
ignore_imports: boolExclude ES import declarations from clone detection.
When enabled, all import statements (value imports, type imports, and
side-effect imports) are stripped from the token stream before clone
detection. This reduces noise from sorted import blocks that naturally
look similar across files. Only affects ES import declarations;
CommonJS require() calls are not filtered.
normalization: NormalizationConfigFine-grained normalization overrides on top of the detection mode.
min_corpus_size_for_shingle_filter: usizeMinimum tokenized file count before focused duplicate analysis prefilters unchanged files with k-token shingles.
min_corpus_size_for_token_cache: usizeMinimum source file count before the persistent duplication token cache
activates. Below this threshold the cache load/save overhead exceeds the
tokenize savings, so the cache stays disabled even when not running with
--no-cache.
Trait Implementations§
Source§impl Clone for DuplicatesConfig
impl Clone for DuplicatesConfig
Source§fn clone(&self) -> DuplicatesConfig
fn clone(&self) -> DuplicatesConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DuplicatesConfig
impl Debug for DuplicatesConfig
Source§impl Default for DuplicatesConfig
impl Default for DuplicatesConfig
Source§impl<'de> Deserialize<'de> for DuplicatesConfig
impl<'de> Deserialize<'de> for DuplicatesConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for DuplicatesConfig
impl JsonSchema for DuplicatesConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more