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
@narwhalsilent 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 iP 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.
privatestaticvoidhandleNonstandardCommand(Strings) throwsNonstandardCommandException {
if (s.startsWith("bye")) { // nonstandard commandthrownewNonstandardCommandException("Thou canst bid me farewell simply with:\nbye");
} elseif (s.startsWith("list")) {
thrownewNonstandardCommandException("Though canst view thy list simply with:\nlist");
} elseif (s.matches("find")) {
thrownewNonstandardCommandException(
"Thou shouldst specify a keyword to search for in thy list of tasks:\n"
+ "find [keyword]");
} elseif (s.startsWith("mark")) {
thrownewNonstandardCommandException(
"Take heed, for thou shouldst reference the task thou wishest to alter by its index:\n"
+ "mark [index]");
} elseif (s.startsWith("unmark")) {
thrownewNonstandardCommandException(
"Take heed, for thou shouldst reference the task thou wishest to alter by its index:\n"
+ "unmark [index]");
} elseif (s.startsWith("delete")) {
thrownewNonstandardCommandException(
"Take heed, for thou shouldst reference the task thou wishest to alter by its index:\n"
+ "delete [index]");
} elseif (s.startsWith("todo")) {
thrownewNonstandardCommandException(
"Thou shouldst forge a todo task such as so:\n"
+ "todo [description]");
} elseif (s.startsWith("deadline")) {
thrownewNonstandardCommandException(
"Thou shouldst forge a deadline task such as so:\n"
+ "deadline [description] /by [time]");
} elseif (s.startsWith("event")) {
thrownewNonstandardCommandException(
"Thou shouldst forge an event task such as so:\n"
+ "event [description] /from [start time] /to [end time]");
} else {
thrownewNonstandardCommandException(
"I beg thine pardon, but I am clueless of the meaning of your utterance.");
}
}
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.
Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement.
Add assertions
Add assertions to ensure program correctness
- Check that `CommandParser` works correctly.
- Check that `Event` and `Deadline` tasks cannot be successfully created with invalid time format.
body not wrapped at 72 characters: e.g., - Check that EventandDeadline tasks cannot be successfully created with invalid time format.
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 👍
ℹ️ 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:
@narwhalsilent 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 iP 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/knight/CommandParser.java
lines47-84
:Example from
src/main/java/knight/TaskList.java
lines26-123
:Example from
src/main/java/knight/TaskList.java
lines226-261
: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/knight/Knight.java
lines23-27
:Example from
src/main/java/knight/Task.java
lines15-17
:Example from
src/main/java/knight/Task.java
lines22-24
: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
ad40cd3
:- Check that
Eventand
Deadlinetasks cannot be successfully created with invalid time format.
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 👍
ℹ️ 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: