Code Review Checklist

Function Inputs
  • Check empty arrays, sets, etc
  • Check null pointer
  • Check minimum and maximum possible values
  • Check out-of-bound index
Function Returns
  • Check null pointer return
  • Check error status
Memory
  • Everything created in constructor should be deleted in destructor.
  • check memory allocation in functions called in constructor
  • Everything deleted in destructor should be created in constructor.
Creation Failures
  • free allocated resources before abort()
Free/delete pointer
  • set pointers to 0 after free/delete
Pointers
  • Check whether they are NULL before used.
Reference Arguments
  • Check whether any function who has reference arguments is passed pointers.
Files
  • Close all opened files.
Comments
  • Add comments to new functions.
  • Add comments to modified functions.
Assert
  • Don't use assert macros to verify external data.
Code modified
  • Compare the modified version with the old version
Code Style
  • Have you copied other's code?
  • Will your code be inserted into other's code?
Metro Code
  • Do the proper inc_ref() and dec_ref()
  • add proper BEGIN_DEMAND to member functions
Names
  • Use descriptive names for globals, short names for locals.
  • Include a brief comment with the declaration of globals.
get_XXX
  • make sure variables used exist; don't assume set_XXX() to be called first.