-
Notifications
You must be signed in to change notification settings - Fork 228
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
[Goh Wei Kiat] iP #270
base: master
Are you sure you want to change the base?
[Goh Wei Kiat] iP #270
Conversation
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.
Overall, it was a pleasant experience reading your code! No major coding standard violations were found, just some minor tweaks that might need to be done here and there. Otherwise, LGTM!
src/main/justin/Justin.java
Outdated
ui.showHelpMessage(); | ||
|
||
// Condition for Duke to stop | ||
boolean terminate = false; |
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.
Should this be canTerminate? Might be better to change to reflect boolean variable name
src/main/justin/Storage.java
Outdated
} | ||
} else if (task.getList().get(i) instanceof Deadline) { // is a deadline class | ||
if (task.getList().get(i).isDone) { | ||
holder = "D" + "|" + "1" + "|" + task.getList().get(i).description + "|" + ((Deadline) task.getList().get(i)).by; |
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.
Might have exceeded line limit
src/main/justin/Ui.java
Outdated
printSpace(); | ||
System.out.println("To add a todo: use command todo<space>taskName"); | ||
System.out.println("To add a deadline: use command deadline<space>taskName<space>/by<space>YYYY-MM-DD"); | ||
System.out.println("To add a event: use command event<space>taskName<space>/at<space>YYYY-MM-DD<space>HH:MM"); |
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.
Might have exceeded line limit
src/main/justin/Ui.java
Outdated
|
||
static String logo = | ||
|
||
" ,--. ,--. ,--. \n" + |
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.
Might want to consider shifting "+" operator to begin on new line
src/main/justin/Event.java
Outdated
|
||
@Override | ||
public String toString() { | ||
return "[E]" + super.toString() + " (at: " + date1.format(DateTimeFormatter.ofPattern("MMM d yyyy")) + " " + |
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.
Might have exceeded line limit
Update JUnit testing
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.
Hi Wei Kiat, I feel that your code is quite well segmented. Great work!
src/main/java/justin/Justin.java
Outdated
|
||
case "DONE": | ||
|
||
String num = text.substring(5); // take out the int value of the task to be completed |
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.
Would it be clearer if a named constant or method was used to extract the task number instead? (instead of using a "magic" number)
src/main/java/justin/Justin.java
Outdated
ui.showHelpMessage(); | ||
|
||
// Condition for Duke to stop | ||
boolean terminate = false; |
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.
I feel that the code is clear enough for certain comments to be omitted!
src/main/java/justin/Storage.java
Outdated
} | ||
} else if (task.getList().get(i) instanceof Deadline) { // is a deadline class | ||
if (task.getList().get(i).isDone) { | ||
holder = "D" + "|" + "1" + "|" + task.getList().get(i).description + "|" + ((Deadline) task.getList().get(i)).by; |
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.
Perhaps use a method to reduce the code duplication here?
if (text.length() < 5 && text.contains("todo") ) { // case 1 | ||
throw new JustinException("☹ OOPS!!! The description of a todo cannot be empty."); | ||
} | ||
else if (text.contains("blah")) { // case 2 |
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.
According to convention and for better readability, maybe consider indenting the trailing comments to the same tab setting?
|
||
} | ||
|
||
|
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.
I think there are times when it is not really necessary to have multiple blank lines in between parts of your code?
PR from branch-A-CodeQuality to master
PR from branch-A-JavaDoc to master
PR branch-A-Assertions
PR branch-Level-10
PR branch-A-CodingStandard
PR branch-Level-9
Reopening my current PR based on feedbacks from Prof