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.
publicStringexecute(TaskListtaskList, Storagestorage) throwsNyxException {
String[] splitInfo = information.split(" ", 2);
assertsplitInfo.length > 0 : "Update information not read in correctly";
try {
intindex = Integer.parseInt(splitInfo[0]) - 1;
if (taskList.getNumTasks() == 0) {
return"No task to delete!";
}
Tasktask = taskList.getTask(index);
if (taskinstanceofToDo) {
task.updateContent(splitInfo[1]);
} elseif (taskinstanceofDeadline) {
String[] secondInfo = splitInfo[1].split(" /by ");
if (secondInfo.length != 2) {
thrownewNyxException("You need to update deadline using the following format:"
+ "\n{ details } /by { datetime }");
}
task.updateContent(secondInfo[0]);
Deadlinedeadline = (Deadline) task;
deadline.changeDateTime(secondInfo[1]);
} else {
String[] secondInfo = splitInfo[1].split(" /at ");
if (secondInfo.length != 2) {
thrownewNyxException("You need to update event using the following format:"
+ "\n{ details } /at { datetime }");
}
task.updateContent(secondInfo[0]);
Eventevent = (Event) task;
event.changeDateTime(secondInfo[1]);
}
storage.overwriteData(taskList);
returnString.format("Noted! I've update this task to:\n %s", task);
} catch (IndexOutOfBoundsException | NumberFormatExceptione) {
thrownewNyxException("Invalid task index!");
} catch (IOExceptione) {
thrownewNyxException("Unable to save the changes...");
}
}
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.
Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement
Aspect: Recent Git Commit Message (Subject Only)
No easy-to-detect issues 👍
ℹ️ 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/nyx/Parser.java
lines24-73
:Example from
src/main/java/nyx/command/UpdateCommand.java
lines19-61
: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
Example from
src/main/java/nyx/task/Task.java
lines39-41
:Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement
Aspect: Recent Git Commit Message (Subject Only)
No easy-to-detect issues 👍
ℹ️ 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: