https://brianjenney.medium.com/lgtm-how-to-write-code-reviews-like-a-senior-developer-a047b5482b18
Checklist
✔️ Branch and commit names are correct
✔️ Screenshots included
✔️ Documentation is created
✔️️ Code is readable
✔️ Styleguides and naming conventions are followed
✔️ Folders / Files structure is reasonable
✔️ Code is structured well. Functions should be broken down into smaller ones
✔️ Tests
User Testing
- Run the code locally of course — before you even look at the code!
- Act as a QA engineer would and try to “break” the functionality by exploring edge cases and explicitly use the feature as unintended
- Open the console and check for any errors or warnings
- If this is a UI change — test against different browsers and screen widths
- Run any associated unit tests
- Run the entire test suite and ensure nothing fails
Code Quality (Only done if user testing does not reveal any issues)
- Repeated code should be abstracted into helpers
- Is it scalable? No nested for loops or computationally expensive functions? Will it work if the input increases by tenfold?
- Immediately clear variable naming conventions
- Functions are concise and typically do only ONE action
- Are errors caught and handled?
- How about test coverage — are all branches tested? For example in a conditional statement, are both paths explored in the test coverage?
As a rule of thumb, almost no code review should be ready on the first pass. There is almost always a line of code, an oversight or a question that should be asked.
For bonus points, record a short video over loom.com that shows any potential errors or bugs you’ve noticed. It is typically easier to show a developer a bug over video rather than writing some complex case that will lead to a back-and-forth in the comment section.
Lastly, be respectful and helpful!