Best Practices of Code Review
- Project and filename should be self explanatory like PaymentService
- Remove unwanted import/using packages statement (use specific lib, don't use * until unless it require)
- Sort all the import/using statement properly
- Don't ignore warning in your project (Address it all and remove), force zero warning before production check in
- Code consistency, reusability and readability
- Do extra care for NULL all the times and put check to handle NULLpointException handler
- Remove unwanted dead/un-used code like variable not being used in application
- Naming convention
- Write proper exception handling (try, catch & finally)
- Properly use access specifier based on architecture (public, protected & private)
- Self documenting code/comments in your code
You can use lot of readymade tools available like FindBug, SonarCube etc.
Comments
Post a Comment