Skip to content

ALL-DUPL0002 · repeated_semantic_string_literal

Find repeated string literals that occupy one exact semantic role.

This is a deterministic rule for all languages. Read its implementation.

Group an exact string value only when every occurrence has the same resolved syntax role. The initial roles are a named keyword on the same alias-resolved callable and one side of the same binary equality comparison against the same dotted operand. Model constructors, Pydantic calls, and Pydantic serialization methods own their keyword vocabularies, so those strings are excluded. Report a group only when it reaches minimum_occurrences, minimum_files, and minimum_length. The default twelve-character floor avoids replacing short local vocabulary with an abstraction whose name is not clearer than the repeated value. The value is the number of qualified groups.

Continue with evidence and references, or open the examples.