@Hugo-Chia We did an automated analysis of your code to detect potential areas to improve the code quality. We are sharing the results below, so that you can avoid similar problems in your tP code (which will be graded more strictly for code quality).
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
Example from src/main/java/artemis/ui/Artemis.java lines 55-55:
Suggestion: Remove dead code from the codebase.
Aspect: Method Length
Example from src/main/java/artemis/command/Parser.java lines 26-114:
public static Command parse(String input) throws ArtemisException {
String command = Parser.parseCommand(input);
if (command.equals(Commands.BYE.name().toLowerCase())) {
return new ExitCommand();
} else if (command.equals(Commands.LIST.name().toLowerCase())) {
return new ListCommand();
} else if (command.equals(Commands.MARK.name().toLowerCase())) {
int index;
try {
index = Parser.parseIntegerCommand(input);
} catch (ArrayIndexOutOfBoundsException e) {
throw new ArtemisException("You did not choose a valid task to mark. Please try again!!! :(\n");
}
return new MarkCommand(index);
} else if (command.equals(Commands.UNMARK.name().toLowerCase())) {
int index;
try {
index = Parser.parseIntegerCommand(input);
} catch (ArrayIndexOutOfBoundsException e) {
throw new ArtemisException("You did not choose a valid task to unmark. Please try again!!! :(\n");
}
return new UnmarkCommand(index);
} else if (command.equals(Commands.DELETE.name().toLowerCase())) {
int index;
try {
index = Parser.parseIntegerCommand(input);
} catch (ArrayIndexOutOfBoundsException | NumberFormatException e) {
throw new ArtemisException("You did not choose a valid task to delete. Please try again!!! :(\n");
}
return new DeleteCommand(index);
} else if (command.equals(Commands.FIND.name().toLowerCase())) {
String keyword;
try {
keyword = Parser.parseKeywordCommand(input);
} catch (ArrayIndexOutOfBoundsException e) {
throw new ArtemisException("Invalid format for find. Please try again!!! :(\n");
}
return new FindCommand(keyword);
} else if (command.equals(Commands.TODO.name().toLowerCase())) {
Todo todo;
try {
todo = (Todo) Parser.parseTask(Commands.TODO, input);
} catch (StringIndexOutOfBoundsException e) {
throw new ArtemisException("You did not fill up anything for todo. Please try again!!! :(\n");
}
return new ToDoCommand(todo);
} else if (command.equals(Commands.DEADLINE.name().toLowerCase())) {
Deadline deadline;
try {
deadline = (Deadline) Parser.parseTask(Commands.DEADLINE, input);
} catch (StringIndexOutOfBoundsException e) {
throw new ArtemisException("You did not fill up anything for deadline. Please try again!!! :(\n");
}
return new DeadlineCommand(deadline);
} else if (command.equals(Commands.EVENT.name().toLowerCase())) {
Event event;
try {
event = (Event) Parser.parseTask(Commands.EVENT, input);
} catch (StringIndexOutOfBoundsException | ArrayIndexOutOfBoundsException | ArtemisException e) {
throw new ArtemisException("You did not fill up anything for event. Please try again!!! :(\n");
}
return new EventCommand(event);
} else if (command.equals(Commands.SORT.name().toLowerCase())) {
String keyword;
try {
keyword = Parser.parseKeywordCommand(input);
} catch (ArrayIndexOutOfBoundsException e) {
throw new ArtemisException("Invalid format for sort. Please try again!!! :(\n");
}
if (!keyword.equals("name") && !keyword.equals("date")) {
throw new ArtemisException("Invalid format for sort. Please try again!!! :(\n");
}
return new SortCommand(keyword);
}
return new UnknownCommand();
}
Suggestion: Consider applying SLAP (and other abstraction mechanisms) to shorten methods e.g., extract some code blocks into separate methods. You may ignore this suggestion if you think a longer method is justified in a particular case.
Aspect: Class size
No easy-to-detect issues 👍
Aspect: Header Comments
No easy-to-detect issues 👍
Aspect: Recent Git Commit Messages
No easy-to-detect issues 👍
Aspect: Binary files in repo
No easy-to-detect issues 👍
❗ You are not required to (but you are welcome to) fix the above problems in your iP, unless you have been separately asked to resubmit the iP due to code quality issues.
ℹ️ The bot account 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.
@Hugo-Chia We did an automated analysis of your code to detect potential areas to improve the code quality. We are sharing the results below, so that you can avoid similar problems in your tP code (which will be graded more strictly for code quality).
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
Example from
src/main/java/artemis/ui/Artemis.javalines55-55://assert false;Suggestion: Remove dead code from the codebase.
Aspect: Method Length
Example from
src/main/java/artemis/command/Parser.javalines26-114:Suggestion: Consider applying SLAP (and other abstraction mechanisms) to shorten methods e.g., extract some code blocks into separate methods. You may ignore this suggestion if you think a longer method is justified in a particular case.
Aspect: Class size
No easy-to-detect issues 👍
Aspect: Header Comments
No easy-to-detect issues 👍
Aspect: Recent Git Commit Messages
No easy-to-detect issues 👍
Aspect: Binary files in repo
No easy-to-detect issues 👍
❗ You are not required to (but you are welcome to) fix the above problems in your iP, unless you have been separately asked to resubmit the iP due to code quality issues.
ℹ️ The bot account 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.