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
@amosting 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.
publicStringisWrongFormat(StringinputCommand, StringvalidInputCommand) {
assert !inputCommand.isEmpty() : "inputCommand parameter in isWrongFormat() is an empty string";
assert !validInputCommand.isEmpty() : "validInputCommand parameter in isWrongFormat() is an empty string";
// since command is valid, check if formatting of the command is correctbooleanmarkMatch = inputCommand.matches("mark \\d+");
booleanuncheckMatch = inputCommand.matches("unmark \\d+");
booleantodoMatch = inputCommand.matches("todo .+ (low|medium|high)");
booleandeadlineMatch = inputCommand.matches("deadline .+ /.+ (low|medium|high)");
booleaneventMatch = inputCommand.matches("event .+ /.+ /.+ (low|medium|high)");
if (validInputCommand.equals("mark") && !markMatch) { // if mark command but wrong formattry {
thrownewWrongJarvisCommandFormatException(
"Apologies Sir, the format of the mark command you provided is incorrect.");
} catch (WrongJarvisCommandFormatExceptione) {
returnUi.getWrongFormatMessage("mark", e);
}
} elseif (validInputCommand.equals("uncheck") && !uncheckMatch) { // if uncheck command but wrong formattry {
thrownewWrongJarvisCommandFormatException(
"Apologies Sir, the format of the uncheck command you provided is incorrect.");
} catch (WrongJarvisCommandFormatExceptione) {
returnUi.getWrongFormatMessage("uncheck", e);
}
} elseif (validInputCommand.equals("todo") && !todoMatch) { // if todo command but wrong formattry {
thrownewWrongJarvisCommandFormatException(
"Apologies Sir, the format of the todo command you provided is incorrect.");
} catch (WrongJarvisCommandFormatExceptione) {
returnUi.getWrongFormatMessage("todo", e);
}
} elseif (validInputCommand.equals("deadline") && !deadlineMatch) { // if deadline command but wrong formattry {
thrownewWrongJarvisCommandFormatException(
"Apologies Sir, the format of the deadline command you provided is incorrect.");
} catch (WrongJarvisCommandFormatExceptione) {
returnUi.getWrongFormatMessage("deadline", e);
}
} else { // if event command but wrong formattry {
thrownewWrongJarvisCommandFormatException(
"Apologies Sir, the format of the event command you provided is incorrect.");
} catch (WrongJarvisCommandFormatExceptione) {
returnUi.getWrongFormatMessage("event", e);
}
}
}
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.
/** * Abstract method for string to date conversion */
Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement.
Add User Guide.
Edited README.md to have a proper user guide for Jarvis chatbot.
Edited some small Ui class return strings to ensure proper and consistent formatting.
Subject line should not end with a period
No blank line between subject and body
body not wrapped at 72 characters: e.g., Edited some small Ui class return strings to ensure proper and consistent formatting.
Add logic to handle new priority feature, for checking of correct user input.
Edited regex expression in TaskList to handle priority field.
Edited return statements in Ui.java to return correct task format for new priority feature.
Longer than 72 characters
Subject line should not end with a period
No blank line between subject and body
body not wrapped at 72 characters: e.g., Edited return statements in Ui.java to return correct task format for new priority feature.
Suggestion: Follow the given conventions for Git commit messages for future commits (do not modify past commit messages as doing so will change the commit timestamp that we used to detect your commit timings).
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:
@amosting 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
Example from
src/main/java/Jarvis/Deadline.java
lines1-1
:Example from
src/main/java/Jarvis/Event.java
lines1-1
:Example from
src/main/java/Jarvis/IncorrectJarvisCommandException.java
lines1-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/Jarvis/Parser.java
lines99-147
:Example from
src/main/java/Jarvis/Parser.java
lines159-244
:Example from
src/main/java/Jarvis/TaskList.java
lines21-72
: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/Jarvis/Task.java
lines59-61
: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
possible problems in commit
4b00c23
:possible problems in commit
6f2d229
:Edited some small Ui class return strings to ensure proper and consistent formatting.
possible problems in commit
6ecc802
:Edited return statements in Ui.java to return correct task format for new priority feature.
Suggestion: Follow the given conventions for Git commit messages for future commits (do not modify past commit messages as doing so will change the commit timestamp that we used to detect your commit timings).
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: