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
@KJunWei 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.
publicStringsendAndReturnMessage(Command.ActionKeywordskeyword, Tasktask, String... values) {
intnumOfTasks = 0;
Stringmessage = "";
if (values.length >= 1) {
numOfTasks = Integer.parseInt(values[0]);
}
if (values.length >= 2) {
message = values[1];
}
switch (keyword) {
caseDEADLINE:
caseTODO:
caseEVENT: {
returnformatMessage("Got it. I've added this task:\n"
+ INDENTATION + EXTRA_INDENTATION + task + "\n"
+ INDENTATION + "Now you have " + numOfTasks
+ (numOfTasks < 2 ? " task" : " tasks") + " in the list.");
}
caseDELETE: {
returnformatMessage("Noted. I've removed the task:\n"
+ INDENTATION + EXTRA_INDENTATION + task + "\n"
+ INDENTATION + "Now you have " + numOfTasks
+ (numOfTasks < 2 ? " task" : " tasks") + " in the list.");
}
caseLIST: {
Stringmsg;
if (message.equals("")) {
msg = formatMessage("There are currently no tasks in your list");
} else {
msg = formatMessage("Here are the task(s) in your list:\n"
+ INDENTATION + message);
}
returnmsg;
}
caseMARK: {
returnformatMessage("Nice! I've marked this task as done:\n"
+ INDENTATION + EXTRA_INDENTATION + task);
}
caseUNMARK: {
returnformatMessage("OK, I've marked this task as not done yet:\n"
+ INDENTATION + EXTRA_INDENTATION + task);
}
caseFIND: {
Stringmsg;
if (message.equals("")) {
msg = formatMessage("Sorry, there are no matching tasks in your list");
} else {
msg = formatMessage("Here are the matching tasks in your list:\n"
+ INDENTATION + message);
}
returnmsg;
}
caseREMIND: {
Stringmsg;
if (message.equals("")) {
msg = formatMessage("You have no uncompleted deadline tasks!");
} else {
msg = formatMessage("Here are the uncompleted tasks in your list:\n"
+ INDENTATION + message);
}
returnmsg;
}
default:
returnnull;
}
}
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.
/** * Main method. * * @param args Given arguments. */
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 👍
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 [email protected] if you want to follow up on this post.
The text was updated successfully, but these errors were encountered:
@KJunWei 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
No easy-to-detect issues 👍
Aspect: Method Length
Example from
src/main/java/duke/command/Command.java
lines97-152
:Example from
src/main/java/duke/ui/Ui.java
lines90-155
: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
Example from
src/main/java/duke/Duke.java
lines88-92
: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 👍
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
[email protected]
if you want to follow up on this post.The text was updated successfully, but these errors were encountered: