I am a penultimate year computer science student from Singapore.
-
π Feel free to view my projects here
This project forked from nus-cs2103-ay2223s2/ip
I am a penultimate year computer science student from Singapore.
π Feel free to view my projects here
@Douglch 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 π
Example from src/main/java/lele/task/TaskList.java
lines 177-177
:
// assert this.listSize() >= inputIndex : "Index parameter queried should be within the task size";
Suggestion: Remove dead code from the codebase.
Example from src/main/java/lele/parser/Parser.java
lines 54-148
:
public static Command parse(String fullCommand) throws UnknownCommandException, EmptyDescException {
try {
String[] inputArr = fullCommand.split(" ");
Commands command = Commands.valueOf(inputArr[0].toUpperCase());
String desc = "variable not initialised";
StringBuilder sb = new StringBuilder();
switch (command) {
case TODO:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! The description of a todo cannot be empty.");
}
for (int i = 1; i < inputArr.length; i++) {
sb.append(inputArr[i]);
if (i != inputArr.length - 1) {
sb.append(" ");
}
}
Todo todo = new Todo(sb.toString().trim());
return new TodoCommand(todo);
case DEADLINE:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! The description of a deadline cannot be empty.");
}
for (int i = 1; i < inputArr.length; i++) {
if (inputArr[i].equals("/by")) {
desc = sb.toString();
sb.setLength(0);
continue;
}
sb.append(inputArr[i]);
if (i != inputArr.length - 1) {
sb.append(" ");
}
}
String[] dateTime = sb.toString().split(" ");
assert !desc.isEmpty() : "desc (deadline description) should be filled, otherwise caught by exception";
Deadline deadline = new Deadline(desc, dateTime[0], dateTime[1]);
return new DeadlineCommand(deadline);
case EVENT:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! The description of an event cannot be empty.");
}
String from = "local variable not initialised";
for (int i = 1; i < inputArr.length; i++) {
if (inputArr[i].equals("/from")) {
desc = sb.toString();
sb.setLength(0);
continue;
} else if (inputArr[i].equals("/to")) {
from = sb.toString();
sb.setLength(0);
continue;
}
sb.append(inputArr[i]);
if (i != inputArr.length - 1) {
sb.append(" ");
}
}
assert !desc.isEmpty() : "desc (event description) should be filled, otherwise caught by exception";
assert !from.isEmpty() : "from (event starting date) should be filled";
Event event = new Event(desc, from, sb.toString().trim());
return new EventCommand(event);
case MARK:
index = Integer.parseInt(inputArr[1]);
return new MarkCommand(index);
case UNMARK:
index = Integer.parseInt(inputArr[1]);
return new UnmarkCommand(index);
case DELETE:
index = Integer.parseInt(inputArr[1]);
return new DeleteCommand(index);
case LIST:
return new ListCommand();
case BYE:
return new ByeCommand();
case FIND:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! You need to specify what you want to find!");
}
return new FindCommand(inputArr[1]);
case UNDO:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! Please specify how many CRUD versions you want to undo!");
}
int index = Integer.parseInt(inputArr[1]);
return new UndoCommand(index);
default:
assert false; // Execution should never reach this point!
throw new UnknownCommandException("OOPS!!! You need to give me an input :-(");
}
} catch (IllegalArgumentException e) {
throw new UnknownCommandException("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/lele/Lele.java
lines 65-69
:
/**
* The main method, initialises the program instance.
*
* @param args Takes in the command line argument.
*/
Example from src/main/java/lele/task/Deadline.java
lines 43-47
:
/**
* The date and time of the deadline, to be stored in the user's data.
*
* @return A string representation of the date and time of the deadline.
*/
Example from src/main/java/lele/task/Event.java
lines 34-38
:
/**
* The starting date and time of the event.
*
* @return String representation of the starting date and time set.
*/
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 bdf730f
:
Changed UG images folder name
Suggestion: Follow the given conventions for Git commit messages for future commits (no need to modify past commit messages).
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.
@Douglch 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 π
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/lele/storage/Storage.java
lines 113-113
:
// System.out.println("entered update storage");
Example from src/main/java/lele/storage/Storage.java
lines 121-121
:
// System.out.println("taskName: " + taskName);
Example from src/main/java/lele/task/TaskList.java
lines 146-146
:
// assert list.contains(list.get(index - 1)) : "The task list should contain the task being marked.";
Suggestion: Remove dead code from the codebase.
Example from src/main/java/lele/parser/Parser.java
lines 44-135
:
public static Command parse(String fullCommand) throws UnknownCommandException, EmptyDescException {
try {
String[] inputArr = fullCommand.split(" ");
Commands command = Commands.valueOf(inputArr[0].toUpperCase());
String desc = "variable not initialised";
StringBuilder sb = new StringBuilder();
switch (command) {
case TODO:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! The description of a todo cannot be empty.");
}
for (int i = 1; i < inputArr.length; i++) {
sb.append(inputArr[i]);
if (i != inputArr.length - 1) {
sb.append(" ");
}
}
Todo todo = new Todo(sb.toString().trim());
return new TodoCommand(todo);
case DEADLINE:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! The description of a deadline cannot be empty.");
}
for (int i = 1; i < inputArr.length; i++) {
if (inputArr[i].equals("/by")) {
desc = sb.toString();
sb.setLength(0);
continue;
}
sb.append(inputArr[i]);
if (i != inputArr.length - 1) {
sb.append(" ");
}
}
String[] dateTime = sb.toString().split(" ");
assert !desc.isEmpty() : "desc (deadline description) should be filled, otherwise caught by exception";
Deadline deadline = new Deadline(desc, dateTime[0], dateTime[1]);
return new DeadlineCommand(deadline);
case EVENT:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! The description of an event cannot be empty.");
}
String from = "local variable not initialised";
for (int i = 1; i < inputArr.length; i++) {
if (inputArr[i].equals("/from")) {
desc = sb.toString();
sb.setLength(0);
continue;
} else if (inputArr[i].equals("/to")) {
from = sb.toString();
sb.setLength(0);
continue;
}
sb.append(inputArr[i]);
if (i != inputArr.length - 1) {
sb.append(" ");
}
}
assert !desc.isEmpty() : "desc (event description) should be filled, otherwise caught by exception";
assert !from.isEmpty() : "from (event starting date) should be filled";
Event event = new Event(desc, from, sb.toString().trim());
return new EventCommand(event);
case MARK:
index = Integer.parseInt(inputArr[1]);
return new MarkCommand(index);
case UNMARK:
index = Integer.parseInt(inputArr[1]);
return new UnmarkCommand(index);
case DELETE:
index = Integer.parseInt(inputArr[1]);
return new DeleteCommand(index);
case LIST:
return new ListCommand();
case BYE:
return new ByeCommand();
case FIND:
if (inputArr.length == 1) {
throw new EmptyDescException("OOPS!!! You need to specify what you want to find!");
}
return new FindCommand(inputArr[1]);
case UNDO:
int index = Integer.parseInt(inputArr[1]);
return new UndoCommand(index);
default:
assert false; // Execution should never reach this point!
throw new UnknownCommandException("OOPS!!! You need to give me an input :-(");
}
} catch (IllegalArgumentException e) {
throw new UnknownCommandException("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/lele/Lele.java
lines 39-43
:
/**
* The function that handles the parsing, storage
* and ui of Lele. Also handles the exceptions coming
* from Command.
*/
Example from src/main/java/lele/Lele.java
lines 65-70
:
/**
* The main method. Initialises a Lele instance and
* starts up the cogwheel.
*
* @param args Takes in the command line argument.
*/
Example from src/main/java/lele/task/Deadline.java
lines 43-48
:
/**
* The date and time of the deadline, to be
* stored in the user's data.
*
* @return A string representation of the date and time of the deadline.
*/
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 15fc248
:
Completed additional extension
possible problems in commit 248fefb
:
Saving changes to remote
possible problems in commit f6a8e44
:
Commented tests out
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.
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.