Code review standard

1. Whether the code implements the functional requirements (business requirements) proposed in the design document

2. Whether the code is properly initialized (variable initialization, initialization and configuration of database, redis, rocketmq, etc.)

3. Code design specifications (camel case naming, The code is indented, the first letter of the class is capitalized, the first letter of the method is lowercase, the static variables are all capitalized, the method parameters are more than 4 abstracted into classes, etc.)

4. Whether the api of the code is reasonable, whether it is easy for users to understand, and do it at the code level Limit misuse

5. Principles of code exception handling (convert underlying exceptions into business exceptions, use TinyException->RuntimeException to prevent api pollution)

6. Whether there is a lot of repetitive code (multiple calls to the same code)

7. Whether there is potential performance in the code Problems (database is not indexed, System
.out, printStackTrace, rude locks, repeated recursion, frequent filter operations)

8. Are there any security risks in the code (each request transmits userId, triggering an infinite loop under special conditions)
while (true ) {         if (threads.size() <= counts || flag) {                 break;         } } 9. Is the code thread safe (flow, spring managed beans must be thread safe) @Component("test") public class Test{         private int COUNT=0;









        public void action(...){                 //Operation COUNT;         } } 10. Code robustness check (empty judgment, array boundary overflow, stack overflow) 11. Code bug check (stream is not closed, uninitialized variables are directly use) 12. Is the code over-designed and over-implemented








Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324498580&siteId=291194637