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 one example is given i.e., there can be other areas/places to improve.
Aspect: Tab Usage
No easy-to-detect issues 👍
Aspect: Brace Style
No easy-to-detect issues 👍
Aspect: Package Name Style
Example from src/main/java/duke/Exceptions/DukeExceptions.java lines 1-1:
Suggestion: Follow the package naming convention specified by the coding standard.
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/Duke.java lines 29-86:
public String getResponse(String input) {
Parser commandParser = new Parser();
String speech = "";
try {
commandParser.parse(input);
String action = commandParser.getCommand(input);
assert action.length() > 1 : "Action not retrieved accurately";
String desc = commandParser.getDesc(input);
switch (action) {
case "bye":
speech += ui.sayGoodbye();
break;
case "list":
speech += ui.printList(tasks.getTaskList());
break;
case "done":
int n = Integer.parseInt(desc);
Task t = tasks.completeTask(n, tasks);
speech += ui.printChecked(t);
break;
case "todo":
Task todo = tasks.addTodo(desc, tasks);
speech += ui.printAdded(tasks.getTaskList(), todo);
break;
case "event":
String date = commandParser.getDate(input);
Task event = tasks.addEvent(desc, date, tasks);
speech += ui.printAdded(tasks.getTaskList(), event);
break;
case "deadline":
String due = commandParser.getDate(input);
Task deadline = tasks.addDeadline(desc, due, tasks);
speech += ui.printAdded(tasks.getTaskList(), deadline);
break;
case "delete":
int index = Integer.parseInt(desc);
Task task = tasks.getTask(index);
tasks.deleteTask(index);
speech += ui.printDeleted(tasks.getTaskList(), task);
break;
case "find":
speech += tasks.findTasks(desc);
break;
case "today":
speech += tasks.getReminder(tasks);
break;
case "weekly":
speech += tasks.getNextReminder(tasks);
break;
default:
throw new UnclearInputException();
}
} catch (DukeExceptions e) {
return e.getMessage();
}
storage.write();
return speech;
}
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 cs2103@comp.nus.edu.sg if you want to follow up on this post.
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 one example is given i.e., there can be other areas/places to improve.
Aspect: Tab Usage
No easy-to-detect issues 👍
Aspect: Brace Style
No easy-to-detect issues 👍
Aspect: Package Name Style
Example from
src/main/java/duke/Exceptions/DukeExceptions.javalines1-1:Suggestion: Follow the package naming convention specified by the coding standard.
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/Duke.javalines29-86: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
cs2103@comp.nus.edu.sgif you want to follow up on this post.