linwanleii / ip Goto Github PK
View Code? Open in Web Editor NEWThis project forked from nus-cs2103-ay2324s1/ip
This project forked from nus-cs2103-ay2324s1/ip
@LinWanLeii 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.
No easy-to-detect issues ๐
Example from src/main/java/tasks/Task.java
lines 9-9
:
private boolean marked;
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)
No easy-to-detect issues ๐
No easy-to-detect issues ๐
No easy-to-detect issues ๐
Example from src/main/java/parser/Parser.java
lines 25-25
:
//final String UNKNOWN_COMMAND = "โน OOPS!!! I'm sorry, but I don't know what that means :-(";
Example from src/main/java/ui/Ui.java
lines 114-114
:
//System.out.println(lineBreak);
Suggestion: Remove dead code from the codebase.
Example from src/main/java/parser/Parser.java
lines 34-110
:
public static Command parse(String fullCommand) throws DukeException {
String[] split = fullCommand.split(" ", 2);
String commandAction = split[0];
switch (commandAction) {
case "list":
return new ListCommand();
case "mark":
if (split.length > 2) {
throw new DukeException("Please state in this format (mark 1)");
}
try {
return new MarkCommand(Integer.parseInt(split[1]));
} catch (NumberFormatException e) {
throw new DukeException("Invalid Index");
}
case "unmark":
if (split.length > 2) {
throw new DukeException("Please state in this format (unmark 1)");
}
try {
return new UnmarkCommand(Integer.parseInt(split[1]));
} catch (NumberFormatException e) {
throw new DukeException("Invalid Index");
}
case "delete":
if (split.length > 2) {
throw new DukeException("Please state in this format (delete 1)");
}
try {
return new DeleteCommand(Integer.parseInt(split[1]));
} catch (NumberFormatException e) {
throw new DukeException("Invalid Index");
}
case "todo":
if (split.length < 2 || split[1].isEmpty()) {
throw new DukeException("โน OOPS!!! The description of a todo cannot be empty.");
}
return new TodoCommand(split[1]);
case "deadline":
if (split.length < 2 || split[1].isEmpty()) {
throw new DukeException("โน OOPS!!! The description of a Tasks.Deadline cannot be empty.");
}
String[] info = split[1].split("/by ");
if (info.length != 2) {
throw new DukeException("โน OOPS!!! The description of a deadline is invalid.");
}
try {
String deadDate = LocalDate.parse(info[1]).format(DateTimeFormatter.ofPattern("MMM d yyyy"));
return new DeadlineCommand(info[0], deadDate);
} catch (DateTimeException e) {
throw new DukeException("โน OOPS!!! The description of a time must be in yyyy-mm-dd");
}
case "event":
if (split.length < 2 || split[1].isEmpty()) {
throw new DukeException("โน OOPS!!! The description of a Tasks.Event cannot be empty.");
}
String[] infoEvent = split[1].split("/from | /to ");
if (infoEvent.length != 3) {
throw new DukeException("โน OOPS!!! The description of a event is invalid.");
}
try {
String startDate = LocalDate.parse(infoEvent[1]).format(DateTimeFormatter.ofPattern("MMM d yyyy"));
String endDate = LocalDate.parse(infoEvent[2]).format(DateTimeFormatter.ofPattern("MMM d yyyy"));
return new EventCommand(infoEvent[0], startDate, endDate);
} catch (DateTimeException e) {
throw new DukeException("โน OOPS!!! The description of a time must be in yyyy-mm-dd");
}
case "clear":
return new ClearCommand();
case "bye":
return new ByeCommand();
case "find":
return new FindCommand(split[1]);
default:
throw new DukeException("โน OOPS!!! I'm sorry, but I don't know what that means :-(");
}
}
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.
No easy-to-detect issues ๐
Example from src/main/java/list/TaskList.java
lines 99-105
:
/**
* UnMark a task as done.
*
* @param i The index of the task.
* @return The task that is unmarked.
* @throws DukeException If the index is out of bound.
*/
Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement.
possible problems in commit 5ea074e
:
Updated CodeQuality, Assertions and Javadocs
Make some edits on codes to improve the quality and readability, update more useful assertions and better javadocs descriptions.
This is so that anyone can easily understand what i happening to my code when reading.
Let's edit the code and ensure that everything is up to standard.
Standards have to be upholded
Make some edits on codes to improve the quality and readability, update more useful assertions and better javadocs descriptions.
possible problems in commit fddbdd9
:
Added Assertions and edited FileStorage file
possible problems in commit a1b7601
:
Update build.gradle file
Need to add a Jar file through shadowjar
This is to ensure that the application will run even if the user does not have JavaFX on their device
ShadowJar from gradle was being used
Let's ensure that we use gradle to its best ability because it is good
This is to ensure that the application will run even if the user does not have JavaFX on their device
Suggestion: Follow the given conventions for Git commit messages for future commits (no need to modify past commit messages).
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.
@LinWanLeii 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.
No easy-to-detect issues ๐
No easy-to-detect issues ๐
No easy-to-detect issues ๐
No easy-to-detect issues ๐
No easy-to-detect issues ๐
No easy-to-detect issues ๐
Example from src/main/java/parser/Parser.java
lines 32-117
:
public static Command parse(String fullCommand) throws DukeException {
String[] split = fullCommand.split(" ", 2);
String commandAction = split[0];
switch (commandAction.toLowerCase()) {
case "list":
return new ListCommand();
case "mark":
if (!split[1].contains(",")) {
if (split.length > 2) {
throw new DukeException("Please state in this format (mark 1)");
}
try {
return new MarkCommand(Integer.parseInt(split[1]));
} catch (NumberFormatException e) {
throw new DukeException("Invalid Index");
}
}
return new MultipleCommand(split[1], "mark");
case "unmark":
if (!split[1].contains(",")) {
if (split.length > 2) {
throw new DukeException("Please state in this format (unmark 1)");
}
try {
return new UnmarkCommand(Integer.parseInt(split[1]));
} catch (NumberFormatException e) {
throw new DukeException("Invalid Index");
}
}
return new MultipleCommand(split[1], "unmark");
case "delete":
if (!split[1].contains(",")) {
if (split.length > 2) {
throw new DukeException("Please state in this format (delete 1)");
}
try {
return new DeleteCommand(Integer.parseInt(split[1]));
} catch (NumberFormatException e) {
throw new DukeException("Invalid Index");
}
}
return new MultipleCommand(split[1], "del");
case "todo":
if (split.length < 2 || split[1].isEmpty()) {
throw new DukeException("โน OOPS!!! The description of a todo cannot be empty.");
}
return new TodoCommand(split[1]);
case "deadline":
if (split.length < 2 || split[1].isEmpty()) {
throw new DukeException("โน OOPS!!! The description of a Tasks.Deadline cannot be empty.");
}
String[] info = split[1].split("/by ");
if (info.length != 2) {
throw new DukeException("โน OOPS!!! The description of a deadline is invalid.");
}
try {
String deadDate = LocalDate.parse(info[1]).format(DateTimeFormatter.ofPattern("MMM d yyyy"));
return new DeadlineCommand(info[0], deadDate);
} catch (DateTimeException e) {
throw new DukeException("โน OOPS!!! The description of a time must be in yyyy-mm-dd");
}
case "event":
if (split.length < 2 || split[1].isEmpty()) {
throw new DukeException("โน OOPS!!! The description of a Tasks.Event cannot be empty.");
}
String[] infoEvent = split[1].split("/from | /to ");
if (infoEvent.length != 3) {
throw new DukeException("โน OOPS!!! The description of a event is invalid.");
}
try {
String startDate = LocalDate.parse(infoEvent[1]).format(DateTimeFormatter.ofPattern("MMM d yyyy"));
String endDate = LocalDate.parse(infoEvent[2]).format(DateTimeFormatter.ofPattern("MMM d yyyy"));
return new EventCommand(infoEvent[0], startDate, endDate);
} catch (DateTimeException e) {
throw new DukeException("โน OOPS!!! The description of a time must be in yyyy-mm-dd");
}
case "clear":
return new ClearCommand();
case "bye":
return new ByeCommand();
case "find":
return new FindCommand(split[1]);
default:
throw new DukeException("โน OOPS!!! I'm sorry, but I don't know what that means :-(");
}
}
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.
No easy-to-detect issues ๐
Example from src/main/java/list/TaskList.java
lines 99-105
:
/**
* Marking the task as unmarked.
*
* @param i The index of the task.
* @return The task that is unmarked.
* @throws DukeException If the index is out of bound.
*/
Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement.
possible problems in commit e7366ad
:
Solved bug relating to checkstyle and gradle
possible problems in commit 098ec94
:
Added more details in readme
possible problems in commit 315a9fd
:
Updated some errors mentioned by the bot
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).
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.