Sei sulla pagina 1di 3

S.No.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Coding Guidelines
Commenting at class level
Commenting at function level
Exception handling
Indentation
naming convention
function length
function arguments
Repeated code
Error logs
Framework/CMS coding convention
If code review is already done, then first check the points raised in previous review
No syntax/runtime errors and warnings in the code
No deprecated functions in the code
A method should not be larger than 40 lines of code.
Always try to initialize the variable before using that in a function.
Always try to use constants in the left hand side of the comparison.
Try to avoid mixing the php code and template
Always try using single quote ( ) when working with the php string
In the case of a system crash never ever put up the error information that expose the internal behavio
Make sure that a proper and uniform coding standard is followed throughout the files.
There should be no magic numbers like 6, 10 etc any numbers like this should be define as a consta
Always try to have unit test for the new piece of code.
Always have an eye on the recursive functions.

Optimizations may often make code harder to read and more likely to contain bugs. Such optimization
identified.
Extra line breaks and dead code should not be present in the code.
Visibility modifiers I.e. public, private or protected should be defined for methods
SQL queries should never be in the loops.
Default values should always be defined for optional parameters of a method.
Inline comments should also be there for specific pieces of code.

If framework/CMS is used in the application, PHP error reporting should not be set for any specific mod
error reporting should be used.

If framework/CMS is used in the application, PHP session should not be used for any specific module o
mechanism should be used.
Input data should strictly be sanitized and validated before passing it to SQL queries.

Data should not be present in the error or debug logs if any particular compliance (PCI, HIPPA etc.) is t

If Webservices are implemented in the application, there should strictly be a security mechanism (suc
Transactions should be used for insertion of related data in multiple tables in the database.

Suggested By
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Sachin Agarwal
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Ankit Jain
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava
Vivek Srivastava

Potrebbero piacerti anche