-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit attendance #157
Edit attendance #157
Conversation
# Conflicts: # src/main/java/seedu/address/commons/core/Messages.java # src/main/java/seedu/address/logic/parser/TutorsPetParser.java # src/test/java/seedu/address/logic/parser/TutorsPetParserTest.java
Codecov Report
@@ Coverage Diff @@
## master #157 +/- ##
============================================
+ Coverage 81.48% 81.93% +0.45%
- Complexity 953 980 +27
============================================
Files 142 144 +2
Lines 2808 2923 +115
Branches 324 343 +19
============================================
+ Hits 2288 2395 +107
- Misses 441 443 +2
- Partials 79 85 +6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some formatting changes
src/main/java/seedu/address/logic/commands/EditAttendanceCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/address/logic/commands/EditAttendanceCommand.java
Outdated
Show resolved
Hide resolved
boolean isLessonIndexPresent = argMultimap.getValue(PREFIX_LESSON_INDEX).isPresent(); | ||
boolean isStudentPresent = argMultimap.getValue(PREFIX_STUDENT_INDEX).isPresent(); | ||
boolean isWeekPresent = argMultimap.getValue(PREFIX_WEEK).isPresent(); | ||
if (!isModuleClassIndexPresent || !isLessonIndexPresent || !isStudentPresent || !isWeekPresent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate guard clause
if (!isModuleClassIndexPresent || !isLessonIndexPresent || !isStudentPresent || !isWeekPresent) { | |
if (!isModuleClassIndexPresent || !isLessonIndexPresent || !isStudentPresent || !isWeekPresent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junlong4321 Actually, for such a case where the Boolean variables are only used in the guard clause, shouldn't they be part of the block for the guard clause?
week = ParserUtil.parseWeek(argMultimap.getValue(PREFIX_WEEK).get()); | ||
|
||
EditAttendanceDescriptor editAttendanceDescriptor = new EditAttendanceDescriptor(); | ||
if (argMultimap.getValue(PREFIX_PARTICIPATION_SCORE).isPresent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (argMultimap.getValue(PREFIX_PARTICIPATION_SCORE).isPresent()) { | |
if (argMultimap.getValue(PREFIX_PARTICIPATION_SCORE).isPresent()) { |
src/test/java/seedu/address/logic/commands/EditAttendanceCommandTest.java
Outdated
Show resolved
Hide resolved
…te code based on review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just a very minor suggestion.
src/main/java/seedu/address/logic/commands/EditAttendanceCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/address/logic/parser/EditAttendanceCommandParser.java
Outdated
Show resolved
Hide resolved
src/main/java/seedu/address/logic/parser/EditAttendanceCommandParser.java
Outdated
Show resolved
Hide resolved
boolean isLessonIndexPresent = argMultimap.getValue(PREFIX_LESSON_INDEX).isPresent(); | ||
boolean isStudentPresent = argMultimap.getValue(PREFIX_STUDENT_INDEX).isPresent(); | ||
boolean isWeekPresent = argMultimap.getValue(PREFIX_WEEK).isPresent(); | ||
if (!isModuleClassIndexPresent || !isLessonIndexPresent || !isStudentPresent || !isWeekPresent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@junlong4321 Actually, for such a case where the Boolean variables are only used in the guard clause, shouldn't they be part of the block for the guard clause?
Closes #139