Professional Documents
Culture Documents
he method or class?
Project Code: BTree.java
Version of the work product:
Reviewer(s): Nguyễn Hồng Nhân 53-64
Trần Đăng Khoa 16-26
Nguyễn Đình Phúc 27-38
Trần Phương Tĩnh 1-15
Trần Ngọc Yên 39-52
Yes
Yes
Các thuộc final hiện tại là ổn
No
Yes
Yes
Yes
Yes
Yes
No, không có subclass
No, không có array reference
Yes
No
Yes
Yes
113: Không kiểm tra BufferPool.getPageSize() Kiểm tra BufferPool.getPageSize() khác 0 trước
trước
Yes khi chia khi chia
Yes
Yes
No
No
Yes
Yes
Yes
Không có break Cần bổ sung comment
No
N/A
Yes
Yes
N/A
Yes
Yes
N/A Thêm dòng if(f.exists()) trước khi thực hiện dòng
No 39, 100, 113, 1038
Yes
N/A
No but acceptable
No
Yes
Yes
Yes
các dòng comment tiếng Trung xen lẫn giữa các
comment tiếng Anh sửa thành tiếng Anh
Yes
Các dòng comment //some code goes here và
các dòng comment đã đề cập không cần thiết xóa bỏ
Yes
55,56,57,61,65,67: BufferPool.getPageSize()
211,213,219: BufferPool.getPageSize() Lưu giá trị vào biến trước để sử dụng
Yes
No
No
34,35: id, pid dễ gây nhầm lẫn
1170: curp Đổi
Đổi id thành
curp bTreePageId
thành currentPage
1208: nextp Đổi nextp thành nextPage
No
Không có biến non-local
No
No
No
Code Review Report
Project Code: GPA-Calculator/Model.java
Version of the work product:
Reviewer(s): Nguyễn Hồng Nhân 53-64
Trần Đăng Khoa 16-26
Nguyễn Đình Phúc 27-38
Trần Phương Tĩnh 1-15
Trần Ngọc Yên 39-52
17 constructor?
Do any subclasses have common members
18 For should
that be inreference:
every array the superclass?
Is each subscript
19 value withinobject
For every the defined
or arraybounds?
reference: Is the
value certain to be non-null?
20 Are there any computations with mixed data 40.109
21 types?
Is overflow or underflow possible during a 115-116
computation?
22 Are parentheses used to avoid ambiguity?
23 Are divisors tested for zero or noise? 115-116,142
24 For every boolean test: Is the correct
25 condition checked? operators correct?
Are the comparison 163
26 Is each boolean expression correct?
Are there improper and unnoticed side-
27 effects
Has anof"&"
a comparison?
inadvertently been interchanged
28 with a "&&" or a "|" for a "||"?
Is every three-way branch
29 (less,equal,greater) covered? 43-103
30 Will
Whenallthere
loopsare
terminate?
multiple exits from a loop, is
31 each exit necessary and handled
Does each switch statement haveproperly?
a default
32 case?
Are missing switch case break statements
33 correct
Can anyand marked
nested with a comment?
if statements be converted
34 into
Are anull
switch statement?
bodied control structures correct
35 and marked with braces or comments?
36 Does every method terminate? 41
37 Are all exceptions
Do named handled appropriately?
break statements send control to
38 the right place?
39 Have all files been opened before use?
40 Have all files been closed after use?
41 Is
Arebuffered data flushed?
files checked for existence before
42 attempting to access them?
agreement with the called method's
43 declaration?
Do the values in units agree (e.g., inches
44 versus yards)?
Does every method, class, and file have an
45 appropriate
Does everyheader comment?or constant
attribute,variable
46 declaration have abehavior
Is the underlying comment?of each method
47 and
classclass expressed
consistent in plain
with the language?
behavior of the
48 method or class?
49 Are all comments
Do the comments consistent with the code?
help in understanding the
50 code?
51 Are there enough comments in the code?
52 Are there too many comments in the code?
53 reduced
Are arrays
by large enough?
computing it once and storing the 91,96,101
54 results?
Is every result that is computed and stored 163,165
55 actually used?
Can a computation be moved outside a
56 loop?
Are there tests within a loop that do not
57 need to bevariables
Are there done? with confusingly similar
58 names?
Are all variables properly defined with
59 meaningful, consistent,
Are there any redundant and
or clear
unusednames?
variables 27.28
60 or attributes?
Could any non-local variables be made
61 local?
Are there any uncalled or unneeded
62 methods?
Can any code be replaced by calls to
63 external reusable
Are there objects?
any blocks of repeated code that
64 could be condensed into a single method? 145,147,148
Comment
Không có design để đánh giá
Không có design để đánh giá
Yes
Yes
Không có design để đánh giá
variable: GradeScaled
Không có design để đánh giá
Yes
Yes
No, tất cả biến đều có sự thay đổi
No
int numberOfRows = 3;
int
YesnumberOfSemesters = 1;
Yes
listOfCredits,
listOfGrades,
Yes. Vì các attributes đã có giá trị được gán giá trị trước
Không có subclass
Yes.
No
40.numberSemesterHours += classHours; (mixed giữa
int
Yesvà double)
Yes
Các biểu thức chia cho 0 chưa được kiểm tra
Yes
163. Toán tử so sánh bằng sử dụng sai
listOfCredits.get(i).getText()
Yes = null
No
No
Chưa được phủ hết các trường hợp
Yes
N/A
N/A
N/A
No
N/A
Yes
listOfGrades có thể chưa được khởi tạo dẫn đến lỗi khi
thực thi lệnh listOfGrades.get(i);
N/A
Không sử dụng file
Không sử dụng file
N/A
Không sử dụng file
N/A
N/A
Không có comment
Không có comment
Không có comment
Không có comment
Không có comment
Không có comment
No
Không có comment
Yes
91,96,101: pieData[3]+1
163,165: listOfCredits.get(i).getText()
Yes
No
No
No
currGpa
cumGpa
No
Không có biến non-local
No
No
formatter.format(percents[3])+"%"
formatter.format(percents[4])+"%"
Suggestion / Fix ?
gradeScaled
return formatter.format(percent)+"%";
}
Code Review Report
Project Code: GPA-Calculator/Controller.java
Version of the work product:
Reviewer(s): Nguyễn Hồng Nhân 53-64
Trần Đăng Khoa 16-26
Nguyễn Đình Phúc 27-38
Trần Phương Tĩnh 1-15
Trần Ngọc Yên 39-52
N/A
N/A
N/A
N/A
N/A
Yes: các hàm trong Model đều được gọi đúng theo
phần declaration của hàm
N/A
Không có comment
Không có comment
Không có comment
Không có comment
Không có comment
Không có comment
No
Không có comment
Không có array
341,345,347: txt_TextField.getText() và
e.getCharacter()
Yes
No
No
text22
233,239,281,287:
239,287: rows row và rows
340: txt_TextField
Các attributes khai báo ở các dòng này không được
sử dụng trong class, không cần thiết phải khai báo
Không có biến non-local
No
No
150,318,322,326: Lặp lại cách add all item cho
Combobox
Suggestion / Fix ?
MODEL
Thay | bằng ||
Bổ sung lệnh else
Đổi
Đổi rows
rows thành
thành index
index
Đổi txt_TextField thành TextFieldElement
Xóa các khai báo ở các dòng này
root
Code Review Report
Project Code: HotelManSys.java
Version of the work product:
Reviewer(s): Nguyễn Hồng Nhân 53-64
Trần Đăng Khoa 16-26
Nguyễn Đình Phúc 27-38
Trần Phương Tĩnh 1-15
Trần Ngọc Yên 39-52
8 Is every variable properly initialized? 26, 41, 75, 76, 211, 255
9 Are all for-loop control variables declared in 103, 211
10 the
Areloop header?
there variables that should be
11 constants?
Are there attributes that should be local
variables?
12 Do all attributes have appropriate access
13 modifiers (private,
Are descriptive protected,
method namespublic)?
used in 74, 102, 326
accord with naming conventions?
14 Do all methods have appropriate access
15 modifiers (private,parameter
Is every method protected,value
public)?
checked 254, 326, 407
before being used?
16 Does each class have an appropriate 18-21,44,48-50
17 constructor?
Do any subclasses have common members
18 For should
that be inreference:
every array the superclass?
Is each subscript
19 value withinobject
For every the defined
or arraybounds?
reference: Is the 472,419-425,270,285,299,313
value certain to be non-null?
20 Are there any computations with mixed data 272,287,301,315
21 types?
Is overflow or underflow possible during a 18-21
22 computation?
Are parentheses used to avoid ambiguity?
23 Are divisors tested for zero or noise?
24 For every boolean test: Is the correct
25 condition checked? operators correct?
Are the comparison 109
26 Is each boolean expression correct?
Are there improper and unnoticed side-
27 effects
Has anof"&"
a comparison?
inadvertently been interchanged
28 with a "&&" or a "|" for a "||"? 536
Is every three-way branch 84
29 (less,equal,greater) covered?
30 Will
Whenallthere
loopsare
terminate?
multiple exits from a loop, is
31 each exit necessary and handled
Does each switch statement haveproperly?
a default
32 case?
Are missing switch case break statements 17, 418, 485
33 correct
Can anyand marked
nested with a comment?
if statements be converted 320
34 into
Are anull
switch statement?
bodied control structures correct
35 and marked with braces or comments?
36 Does every method terminate? 361, 367, 368, 379, 385, 386,
37 Are
Do named break statements send control to 397, 419, 421, 423, 425
all exceptions handled appropriately?
38 the right place?
39 Have all files been opened before use?
40 Have all files been closed after use?
41 Is
Arebuffered data flushed?
files checked for existence before
42 attempting to access them?
agreement with the called method's
43 declaration?
Do the values in units agree (e.g., inches
44 versus yards)?
Does every method, class, and file have an
45 appropriate
Does everyheader comment?or constant
attribute,variable
46 declaration have abehavior
Is the underlying comment?of each method
47 and
classclass expressed
consistent in plain
with the language?
behavior of the
48 method or class?
49 Are all comments
Do the comments consistent with the code?
help in understanding the
50 code?
51 Are there enough comments in the code?
52 Are there too many comments in the code?
53 reduced
Are arrays
by large enough?
computing it once and storing the 367,368,379
54 results?
Is every result that is computed and stored 385,386,397
55 actually used?
Can a computation be moved outside a
56 loop?
Are there tests within a loop that do not 273,288,302,316
57 need to bevariables
Are there done? with confusingly similar 408
58 names?
Are all variables properly defined with 478
480
59 meaningful, consistent,
Are there any redundant and
or clear
unusednames?
variables 545
60 or attributes?
Could any non-local variables be made 327
61 local?
Are there any uncalled or unneeded
62 methods?
Can any code be replaced by calls to
63 external reusable
Are there objects?
any blocks of repeated code that 331-345,349-363,367-381,385-
64 could be condensed into a single method? 399
Comment
Không có design để đánh giá
Không có design để đánh giá
Yes
Yes
Không có design để đánh giá
variable: itemno, rn, rtype, hotel_ob, Rn
Không có design để đánh giá
contact, gender, gender2, name, name2, contact2,
int
int j,count=0;
j
No
No
Yes
CustDetails, bookroom, Deallocate
Yes
int rn
No. 18-21: attribute price thiếu this
No 44: attribute name không tồn tại
No
No.
hotel_ob.luxury_doublerrom[rn];hotel_ob.deluxe_doubler
Yes.amount+=obb.price;
Yes, tùy vào giá trị quantity người dùng truyền vào
Yes
No, Không có phép chia cho 0
Yes
No .
hotel_ob.luxury_doublerrom[j]=null
Yes
No
Sử dụng |
Trường hợp >= 3 chưa được bao gồm
Yes
N/A
Chưa có default case
default chưa có break
N/A
N/A
Yes
N/A
Yes
No
N/A
Yes
Yes: các hàm trong Hotel đều được gọi đúng theo phần
declaration của hàm
N/A
Không có comment
Không có comment
Không có comment
Không có comment
Không có comment
Không có comment
No
Không có comment
Yes
367,368,379: hotel_ob.luxury_singleerrom
385,386,397: hotel_ob.deluxe_singleerrom
Yes
273,288,302,316: String format = "%-10s%-10s%-10s
%n";
No
408: Hai biến i,q dễ gây hiểu nhầm với nhau
478:
480: Hai
Khaibiến
báoch,ch2
label làdễ
x gây hiểu nhầm với nhau
545: Khai báo biến t
327: biến j không được sử dụng
Không có biến non-local
No
No
331-345,349-363,367-381,385-399: Lặp lại 1 kiểu tính
toán
Suggestion / Fix ?
Thay | bằng ||
Có thể dùng thêm lệnh else
Thêm dòng fout.close() sau dòng 455; thêm dòng fin.close() sau
dòng 475
381,385-399:
void deallocateRoom(Singleroom[] roomList);
Project Code: UserDAO.java
Version of the work product:
Reviewer(s): Nguyễn Hồng Nhân 53-64
Trần Đăng Khoa 16-26
Nguyễn Đình Phúc 27-38
Trần Phương Tĩnh 1-15
Trần Ngọc Yên 39-52
col,
fullname, location, phone, category, username
Di chuyển int COL = 0 ở dòng 195 vào phần initialization của for header ở dòng 197,
Di chuyển
fianl int columnIndex == 1metaData.getColumnCount();
int COLUMN_COUNT ở dòng 204 vào phần initialization của for header ở dòng
deleteUserDAO
Thêm điều kiện if(file.exists()) trước khi thực hiện dòng 115
sửa con -> connection, pstmt -> preparedStatement, stmt -> statement, rs -> result,
getQueryResult1 -> getQueryResult