Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

garry414's avatar

Reviewing code for someone senior

So, I've been asked by my manager to do a code review for him. I'm a very very very junior doveloper. How can I possibly do a meaningful review of his code? Any advice? https://1921681254.mx/

0 likes
3 replies
Notdavis's avatar

Everyone can benefit from a code review, so what is it specific you are asking? Are you looking for advice on what to look for in his code?

drewdan's avatar

Everyone makes mistakes writing code, so there is a chance your manager might have made a mistake, or, you might spot an alternative way of doing something which might be more efficient.

When I do code reviews, I tend to:

  • read the issue and PR fully, so you understand what the point of the PR is, what is it supposed to do? What design decisions have been made? etc
  • have a first pass over checking for typos, missing return types, linting errors, incorrect doc blocks, that kind of thing. These are things which can easily be overlooked by might not affect the functionality of the code. This first pass also lets you get to grips with the sections of the code and what they do
  • run the code locally and follow any set testing instructions to make sure it does what it is supposed too, if possible, have a tool like Laravel Telescope running (if it's Laravel) to check for N+1 queries and to make sure the requests/responses look like you'd expect
  • whilst not applicable to all, if you are running your website serverless using Laravel Vapor, it's always good to check the responses sizes are as slim as possible, as AWS lambda limits can return 502s in production you might not see locally.
  • run and document some destructive tests, for example, if you have crud forms to test, throw some garbage data into it, (data too long, no data, all, all special characters) - and then click buttons, a double click on a create button can often lead to duplicated data which might break something. This will help you catch the edge cases that might have been missed. Make sure you document these tests and note them on the PR, so everyone can see the extent of the testing that was one.
  • check for automated test coverage and make sure it's suitable and testing everything it should be
  • look for alternative approaches to the methods used, you might spot a better/cleaner way of writing code. I commonly do better with Laravel collections than some of my colleagues, so often suggest nicer ways to utilize these.

A big point I'd make here, is code reviews don't just benefit the person you are reviewing, they benefit you too. You are tasked with looking at code you may have not looked at before, at the end of the review you will have a better understanding of the application you are working on, and you might learn some tricks from the person you are reviewing.

Don't rush, I imagine your manager would appreciate a thorough review that takes a little longer, instead of a quick review that might miss a bit.

Finally, it might all work fine and you might no find anything wrong, but as long as you have documented what you have looked out for one the PR, they will know you have been thorough and reviewed it to the best of your ability.

Good luck with it, and have fun!

Please or to participate in this conversation.