Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 472 Bytes

unused-variable.md

File metadata and controls

22 lines (14 loc) · 472 Bytes

Pattern: Unused variable

Issue: -

Description

Variables that are declared and not used anywhere in the code are most likely an error resulting from incomplete refactoring. Such variables take up space in the code and can lead to confusion by readers. Use or remove them to resolve this issue.

Example of incorrect code:

number = 100

print "Program contains unused variable"

Example of correct code:

number = 100

print number;