Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vovayartsev/efc8ca4870c5bda40e2d755000cd4565 to your computer and use it in GitHub Desktop.
Save vovayartsev/efc8ca4870c5bda40e2d755000cd4565 to your computer and use it in GitHub Desktop.
Code Review Checklist
- General
[ ] The code works
[ ] The code is easy to understand
[ ] Follows coding conventions
[ ] Names are simple and if possible short
[ ] Names are spelt correctly
[ ] Names contain units where applicable
[ ] There are no usages of 'magic numbers'
[ ] Design patterns if used are correctly applied
[ ] Law of Demeter is not violated
[ ] All variables are in the smallest scope possible
[ ] There is no dead code (inaccessible at Runtime)
[ ] No code can be replaced with library functions
[ ] Required logs are present
[ ] Frivolous logs are absent
[ ] Debugging code is absent
[ ] No IO.inspect / console.log present
[ ] Variables are not accidentally used with null values
[ ] Variables are immutable where possible
[ ] Code is not repeated or duplicated
[ ] No complex/long boolean expressions
[ ] No negatively named boolean variables
[ ] Exceptions are not eaten if caught, unless explicitly documented otherwise
[ ] APIs and other public contracts check input values and fail fast
[ ] Floating point numbers are not compared for equality
[ ] Blocks of code inside loops are as small as possible
- Database
[ ] Migrations present not only the table structure, but also for the legacy data if applicable
[ ] N+1 query problems mitigated
- Documentation
[ ] Comments exist and describe rationale or reasons for decisions in code
[ ] All edge cases are described in comments
[ ] All unusual behaviour or edge case handling is commented
[ ] Data structures and units of measurement are explained
- Security
[ ] All data inputs are checked (for the correct type, length/size, format, and range)
[ ] Invalid parameter values handled such that exceptions are not thrown
[ ] No sensitive information is logged or visible in a stacktrace
- JS only
[ ] `this` context is not lost in `.then(...)` chains
[ ] errors in promises are properly handled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment