Code reviews are important , they make you take another look at you code before you submit it.
After going through a lot of code reviews here are 10 tips to make sure you prepare properly.
1. Clean up your code
Remove those commented out code sections, indent your code properly.
Clean code displays preparation and respect for the reviewer, it also makes you go over all the files you changed which can help you find todos you forgot.
2. Refactoring
Check for duplicate code you can extract into a function, Does your function name really represent what it does? Maybe it's too smart and needs to be divided into several functions.
3.Security
Rethink you code from a security perspective, did you sanitize user inputs? Does you code execute shell scripts? Under what permissions?
If your code writes to the database make sure you encode the input and use prepared statements.
Does the data need to be encrypted?
4. Design
Could the code have reused existing functionality?
What design patterns are used in you code?
Is the code in the correct packages?
5. Comments
Your function and class names may be self explanatory but there is no substitute for code comments. Chances are you won't remember in a week why you used that function and the developer after you sure won't. Looking at the code can tell you how the program works but comments can tell you why it works.
6. Write down the comments from your peers
You won't remember what they said once the meeting is over, writing down comments shows that you are able to accept criticism.
7. Plan for at least 60 minutes but not more
If there is a lot of code to go over split the review into another meeting.
8. Focus on what matters
Nobody is interested in looking at the automatically generated getters and setters in you code. Show the main functionality you've added , focus on what needs to be tested after your changes.
9. Performance
Keep performance in mind, does you code need to adhere to an SLA? if so , provide proof that this has been tested.
Don't call the server/database twice if you can do it once , it may not seem like a big deal but it adds up. Look for loops that contain network calls or database queries.
Does you code close connections properly?
Do you use timeouts? How do you know you picked the correct timeout? What happens if the timeout is reached?
Do you use caching? when are items invalidated?
10. Error handling
How did you handle exceptions in you code? from incorrect user data to network and database failures, Make sure your code can recover and log the exceptions.