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
@markbiju 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.
Suggestion: Follow the given naming convention for boolean variables/methods (e.g., use a boolean-sounding prefix).You may ignore the above if you think the name already follows the convention (the script can report false positives in some cases)
publicstaticCommandparse(StringfullCommand) throwsDukeException {
switch (fullCommand) {
case"bye":
returnnewExitCommand();
case"list":
returnnewListCommand();
case"todo":
thrownewDukeException("Buddy!!! You gotta tell me what it is exactly you want me to add as a to-do!");
case"deadline":
thrownewDukeException("Bud, a deadline needs a description, a date and a time yo!");
case"event":
thrownewDukeException("Buddy you didn't tell me where your date was!!");
default:
String[] arrOfStr = fullCommand.split(" ", 2);
if (arrOfStr.length > 1) {
Stringcommand = arrOfStr[0];
switch (command) {
case"todo":
returnnewTodoCommand(arrOfStr[1]);
case"deadline": {
String[] arrOfStr2 = arrOfStr[1].split("/", 2);
String[] arrOfStr3 = arrOfStr2[1].split(" ", 3);
returnnewDeadlineCommand(arrOfStr2[0], LocalDate.parse(arrOfStr3[1]), arrOfStr3[2]);
}
case"event": {
String[] arrOfStr2 = arrOfStr[1].split("/", 2);
String[] arrOfStr3 = arrOfStr2[1].split(" ", 2);
assert (arrOfStr3[0].equals("at")) : "event command is not entered properly.";
returnnewEventCommand(arrOfStr2[0], (" " + arrOfStr3[1]));
}
case"find":
returnnewFindCommand(arrOfStr[1]);
default:
intnumber = Integer.parseInt(arrOfStr[1]);
switch (command) {
case"mark":
returnnewMarkCommand(number);
case"unmark":
returnnewUnmarkCommand(number);
case"delete":
returnnewDeleteCommand(number);
case"snooze":
returnnewSnoozeCommand(number);
default:
thrownewDukeException("Bud!!! What in the world " +
"are you talking about? Are you following the right format bud?");
}
}
} else {
thrownewDukeException("Bud!!! What in the world are you talking about? Are you following the" +
" right format bud?");
}
}
}
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.
/** * Boolean indicative of whether program should end * @return boolean indicative of whether program should end */
Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement.
Suggestion: Avoid committing binary files (e.g., *.class, *.jar, *.exe) or third-party library files in to the repo.
❗ 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:
@markbiju 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
Example from
src/main/java/duke/Storage.java
lines37-37
:Suggestion: Follow the given naming convention for boolean variables/methods (e.g., use a boolean-sounding prefix).You may ignore the above if you think the name already follows the convention (the script can report false positives in some cases)
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/duke/Parser.java
lines9-9
:// private String command;
Suggestion: Remove dead code from the codebase.
Aspect: Method Length
Example from
src/main/java/duke/Parser.java
lines17-70
:Example from
src/main/java/duke/Storage.java
lines26-79
: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: Class size
No easy-to-detect issues 👍
Aspect: Header Comments
Example from
src/main/java/duke/DeadlineCommand.java
lines32-35
:Example from
src/main/java/duke/EventCommand.java
lines29-32
:Example from
src/main/java/duke/ListCommand.java
lines15-18
: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)
possible problems in commit
354d8b1
:Ui.png
Suggestion: Follow the given conventions for Git commit messages for future commits (no need to modify past commit messages).
Aspect: Binary files in repo
src\main\out\production\main\duke\Command.class
src\main\out\production\main\duke\Deadline.class
src\main\out\production\main\duke\DeadlineCommand.class
Suggestion: Avoid committing binary files (e.g.,
*.class
,*.jar
,*.exe
) or third-party library files in to the repo.❗ 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: