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
@nerdyboy98 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.
publicStringparse(StringuserMessage) {
String [] parts = userMessage.split(" ", 2);
if (parts[0].equals("bye")) {
returnbye();
} elseif (parts[0].equals("list")) {
returnlist();
} elseif (parts[0].equals("mark")) {
returnmark(userMessage);
} elseif (parts[0].equals("unmark")) {
returnunmark(userMessage);
} elseif (parts[0].equals("delete")) {
returndelete(userMessage);
} elseif (parts[0].equals("todo")) {
try {
TodonewToDo = newTodo(parts[1]);
returnthis.taskList.add(newToDo);
} catch (IndexOutOfBoundsExceptione) {
return"Bruhh.. The description of todo cannot be empty.";
}
} elseif (parts[0].equals("deadline")) {
try {
String[] deadlineParts = parts[1].split(" /");
String[] deadline = deadlineParts[1].split(" ", 2);
LocalDatebyDate = LocalDate.parse(deadline[1]);
DeadlinenewDeadline = newDeadline(deadlineParts[0], byDate);
returnthis.taskList.add(newDeadline);
} catch (IndexOutOfBoundsExceptione) {
return"Bruhh.. The description of deadline cannot be empty.";
} catch (DateTimeParseExceptione) {
return"Incorrect date format dude.. try again~";
}
} elseif (parts[0].equals("event")) {
try {
String[] eventParts = parts[1].split(" /");
String[] from = eventParts[1].split(" ", 2);
String[] to = eventParts[2].split(" ", 2);
LocalDatefromDate = LocalDate.parse(from[1]);
LocalDatetoDate = LocalDate.parse(to[1]);
EventnewEvent = newEvent(eventParts[0], fromDate, toDate);
returnthis.taskList.add(newEvent);
} catch (IndexOutOfBoundsExceptione) {
return"Bruhh.. The description of event cannot be empty.";
} catch (DateTimeParseExceptione) {
return"Incorrect date format dude.. try again~";
}
} elseif (parts[0].equals("find")) {
try {
Stringkeyword = parts[1];
returnthis.taskList.find(keyword);
} catch (IndexOutOfBoundsExceptione) {
return"Bruhh.. You gotta tell me what to search for :<";
}
} else {
return"I have no idea what are you talking about dude..";
}
}
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.
ℹ️ 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:
@nerdyboy98 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
Example from
src/main/java/duke/Duke.java
lines45-45
://System.out.println(greetings);
Example from
src/main/java/duke/Duke.java
lines62-62
://this.parser.parse(userInput);
Example from
src/main/java/duke/Duke.java
lines64-64
://return "lol";
Suggestion: Remove dead code from the codebase.
Aspect: Method Length
Example from
src/main/java/duke/Parser.java
lines33-89
: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
No easy-to-detect issues 👍
Aspect: Recent Git Commit Message (Subject Only)
possible problems in commit
22d5006
:Changed layout to comply with coding standards
Suggestion: Follow the given conventions for Git commit messages for future commits (no need to modify past commit messages).
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: