IfSQ
Don't Repeat Yourself (DRY)
Research Finding:
The DRY principle: Don't Repeat Yourself.
IfSQ Defect Indicators based on this finding:
-
SPM-1—Magic Numbers
Numeric literals (other than 0 or 1) have been hard-coded into the body of a program. -
SPM-2—Magic Strings
A string literal has been hard-coded into a statement that influences the flow of a program. -
SPM-3—Copy/Paste Programming
An identical or largely similar section of code appears in two or more places in the same source code file.
Source: