logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

TooMuchCode::ProhibitDuplicateLiteral - Don't repeat yourself with identical literals

Configuration

       Some strings/numbers may be allowed to have duplicates by listing them in the "allowlist" parameter in
       the configs:

           [TooMuchCode::ProhibitDuplicateLiteral]
           allowlist = 'present' "forty two" 42

       The values is a space-separated list of numbers or quoted string.

       The default values in the allowlist are: "0 1". These two numbers are always part of allowlist and cannot
       be removed.

       Please be aware that, a string literal and its numerical literal counterpart (1 vs "1") are considered to
       be the same. Adding "42" to the allowlist is the same as adding 42.

perl v5.36.0                                       2023-10-05              Perl::Critic::...uplicateLiteral(3pm)

Description

       This policy checks if there are string/number literals with identical value in the same piece of perl
       code. Usually that's a small signal of repeating and perhaps a small chance of refactoring.

Name

       TooMuchCode::ProhibitDuplicateLiteral - Don't repeat yourself with identical literals

See Also