-
Notifications
You must be signed in to change notification settings - Fork 187
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
[Ma Jiajun] iP #197
base: master
Are you sure you want to change the base?
[Ma Jiajun] iP #197
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, good job!
@@ -0,0 +1,40 @@ | |||
public class TaskFactory { |
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.
Avoid long methods. Take corrective action when the method exceeds 30 lines of code.
src/main/java/CommandParser.java
Outdated
throw new HandleException("The input cannot be empty!"); | ||
} else if (userInput.equalsIgnoreCase("list")) { | ||
taskList.listTasks(); | ||
} else if (!userInput.startsWith("todo") && !userInput.startsWith("deadline") && !userInput.startsWith("event")) { |
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.
This is a fairly complex statement. You might want to break this into sub-expressions and store values into some boolean variables to check for the "if" condition.
src/main/java/TaskList.java
Outdated
} | ||
|
||
public void addTask(String userInput) throws HandleException { | ||
// Similar to addTask method in TaskManager, but refactored for this class |
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.
Make sure the comments are for the reader and not private notes for yourself. It should help in increasing code readability.
String type = parts[0]; | ||
Task task = null; | ||
|
||
if (parts.length < 2 || parts[1].isEmpty()) { |
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.
Avoid the use of Magic numbers.
checked coding standard and quality
checked coding standard and quality
No description provided.