Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When the block is small, the danger of reusing variable names is mitigated by the visibility of the immediate declaration. Even in this case, however, variable name reuse is not desirable. In general, the larger the declarative region of an identifier, the more descriptive and verbose should be the name of the identifier.

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

DCL00DCL01-PL

lowLow

probableProbable

mediumMedium

P2P4

L3

...

CERT C++ Secure Coding Standard: DCL01-CPP. Do not reuse variable names in subscopes
CERT C Secure Coding Standard: DCL01-C. Do not reuse variable names in subscopes

Automated Detection

Implemented

Tool

 Version

Checker

 Description

B::Lint

 5.0

.* masks earlier declaration in same scope

Implemented  Perl::Critic 5.0Modules_ProhibitEvilModules

Related Guidelines

Bibliography

 

...

Image Modified Image Modified Image Modified