Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 76327
Status: new
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: EDAVIS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.117
Fixed in: (no value)



Subject: Suggested policy: if string constant exists, check it is used consistently
Often you abstract out a commonly-occuring string into a constant. For example my $maintainer = 'support@foo.com'; ... die "unexpected error - please contact $maintainer"; But you may forget about that constant and use the string directly in some cases: my $maintainer = 'support@foo.com'; ... die "unexpected error - please contact $maintainer"; ... warn 'strange condition - report to support@foo.com'; It would be useful to have a policy which, on seeing a string variable defined in the code with a compile-time string, warns about occurrences of that string later on in the code, in places where the variable is in scope.