IfSQ
WIP-3—Empty Statement Block
Defect Indicators: There is a placeholder for program logic containing no code and no explanation as to why it is empty. For example, any of the following words or symbols with nothing in between:
- “BEGIN END”
- “IF ENDIF”
- “ELSE ENDIF”
- {}
- Or:
- a paragraph containing a return
- a routine with just RETURN FALSE
Risks: The empty block may indicate missing functionality. In other words, the programmer has decided at some point that code needs to be written, but has not started the work.
- If there is missing functionality, the problem may be found during testing and need to be fixed, or it may be found after the program goes into production, with unforeseen consequences, such as a crash or malfunction.
- If no code is actually required, a maintenance programmer may waste time later figuring this out.
Assessment:
- Mark all of the disabled lines of code.
Remedy:
- Find out what code should be there and put it in, OR
- Add a comment to explain why no code is required, OR
- Remove the empty block.