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
@Denniszedead 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.
voidcreateDeadlineCommand_correctDeadline_createDeadlineInFile() {
Stringinitial = "";
StringexpectedOne =
"Added the following deadline into the list:\n[D][ ] Deadline 1 (by: 01 Jan 2022 11:59 PM)";
StringexpectedTwo = "DEADLINE\n"
+ "false\n"
+ "Deadline 1\n"
+ "1/1/2022 2359\n"
+ "*** Next Task ***\n";
try {
Storagestorage = newStorage(fileName);
TaskListtasks = newTaskList();
FiledataFile = newFile(fileName);
Scannersc = newScanner(fileName);
FileWriterfw = newFileWriter(dataFile);
// Checks whether the file is empty.Stringresult = "";
sc = newScanner(dataFile);
while (sc.hasNext()) {
result += sc.nextLine() + "\n";
}
Assertions.assertEquals(initial, result);
// Check whether the command is createdCommandcmd = Command.getCommand("DEADLINE", "Deadline 1 /by 01/01/2022 2359");
result = cmd.run(tasks, storage);
Assertions.assertEquals(expectedOne, result);
// Checks whether data is saved in the dataFile.result = "";
sc = newScanner(dataFile);
while (sc.hasNext()) {
result += sc.nextLine() + "\n";
}
Assertions.assertEquals(expectedTwo, result);
// Clears the dataFile.fw.write("");
fw.close();
} catch (Exceptione) {
e.printStackTrace();
Assertions.fail();
}
}
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.
/** * Prase the user input and returns the corresponding command. * * @param userInput The input entered by the user. * @return The Command as typed by the user. * @throws InvalidCommandException If the user inputs an invalid command. */
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:
@Denniszedead 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/test/java/duke/command/TestCommand.java
lines103-153
:Example from
src/test/java/duke/command/TestCommand.java
lines174-224
:Example from
src/test/java/duke/command/TestCommand.java
lines346-391
: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
src\test\java\duke\command\TestCommand.java
(626 lines)Suggestion: Consider breaking large classes into smaller ones, if appropriate. A long class is a sign that perhaps it is dong 'too much'.
Aspect: Header Comments
Example from
src/main/java/duke/praser/Parser.java
lines10-16
:Example from
src/main/java/duke/task/Task.java
lines56-60
:Example from
src/main/java/duke/task/Task.java
lines132-136
: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: