You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We did an automated analysis of your code to detect potential areas to improve the code quality. We are sharing the results below, to help you improve the code further.
IMPORTANT: Note that the script looked for just a few easy-to-detect problems only, and at-most three example are given i.e., there can be other areas/places to improve.
publicStringparse(Stringinput) throwsDukeException {
if (input.equals("bye")) {
returnui.showBye();
}
if (input.equals("list")) {
returnui.showTaskList(this.tasks, "list");
}
if (input.contains("done")) {
inttaskNum = getNum(input);
Tasktask = tasks.getTask(taskNum);
task.markAsDone();
storage.updateData(tasks);
returnui.showTaskDone(task);
}
if (input.contains("todo")) {
Stringname = getName(input);
if (!name.equals("")) {
ToDotoDo = newToDo(name);
tasks.addTask(toDo);
storage.updateData(tasks);
returnui.showTaskAdded(toDo, tasks.getSize());
}
}
if (input.contains("deadline")) {
Stringdescription = getName(input);
if (checkDescriptionIsValid(description, "/by", "deadline")) {
String[] parts = description.split("/by");
Stringname = parts[0];
LocalDateTimeby = getDateTime(parts[1]);
Deadlinedeadline = newDeadline(name, by);
tasks.addTask(deadline);
storage.updateData(tasks);
returnui.showTaskAdded(deadline, tasks.getSize());
}
}
if (input.contains("event")) {
Stringdescription = getName(input);
if (checkDescriptionIsValid(description, "/at", "event")) {
String[] parts = description.split("/at");
Stringname = parts[0];
LocalDateTimeat = getDateTime(parts[1]);
Eventevent = newEvent(name, at);
tasks.addTask(event);
storage.updateData(tasks);
returnui.showTaskAdded(event, tasks.getSize());
}
}
if (input.contains("delete")) {
inttaskNum = getNum(input);
Tasktask = tasks.getTask(taskNum);
tasks.deleteTask(task);
storage.updateData(tasks);
returnui.showTaskDeleted(task, tasks.getSize());
}
if (input.contains("find")) {
Stringkeyword = getName(input);
if (!keyword.equals("")) {
TaskListt = tasks.matchTasks(keyword);
returnui.showTaskList(t, "find");
}
}
returninvalidEntry();
}
Suggestion: Consider applying SLAP (and other abstraction mechanisms) to shorten methods. You may ignore this suggestion if you think a longer method is justified in a particular case.
ℹ️ The bot account @cs2103-bot used to post this issue is un-manned. Do not reply to this post (as those replies will not be read). Instead, contact [email protected] if you want to follow up on this post.
The text was updated successfully, but these errors were encountered:
We did an automated analysis of your code to detect potential areas to improve the code quality. We are sharing the results below, to help you improve the code further.
IMPORTANT: Note that the script looked for just a few easy-to-detect problems only, and at-most three example are given i.e., there can be other areas/places to improve.
Aspect: Tab Usage
No easy-to-detect issues 👍
Aspect: Naming boolean variables/methods
No easy-to-detect issues 👍
Aspect: Brace Style
No easy-to-detect issues 👍
Aspect: Package Name Style
No easy-to-detect issues 👍
Aspect: Class Name Style
No easy-to-detect issues 👍
Aspect: Dead Code
No easy-to-detect issues 👍
Aspect: Method Length
Example from
src/main/java/duke/HelpPage.java
lines43-91
:Example from
src/main/java/duke/parser/Parser.java
lines42-113
:Suggestion: Consider applying SLAP (and other abstraction mechanisms) to shorten methods. You may ignore this suggestion if you think a longer method is justified in a particular case.
Aspect: Header Comments
No easy-to-detect issues 👍
Aspect: Recent Git Commit Message (Subject Only)
possible problems in commit
d306b9e
:added help page
possible problems in commit
9b7296a
:Merge branch 'branch-A-CodeQuality' of https://github.com/greyguy21/ip into branch-A-CodeQuality
Suggestion: Follow the given conventions for Git commit messages
ℹ️ The bot account @cs2103-bot used to post this issue is un-manned. Do not reply to this post (as those replies will not be read). Instead, contact
[email protected]
if you want to follow up on this post.The text was updated successfully, but these errors were encountered: