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
@markgcera 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.
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)
publicStringwork(String[] inputParts, ArrayList<Task> taskList) {
assertinputParts != null;
try {
TasknewTask;
if (inputParts.length < 2) {
thrownewIrisException("☹ OOPS!!! The content of a command cannot be empty.");
}
Stringcontent = inputParts[1];
switch (inputParts[0]) {
case"todo":
TodoDuplicateDetectortodoDuplicateDetector = newTodoDuplicateDetector();
if (todoDuplicateDetector.checkDuplicates(content, taskList)) {
return"Error: This todo task already exists.";
}
newTask = newTodo(content);
break;
case"deadline": {
String[] contentParts = content.split(" /by ", 2);
Stringdescription = contentParts[0];
StringdateOfDeadline = contentParts[1];
DeadlineDuplicateDetectordeadlineDuplicateDetector = newDeadlineDuplicateDetector();
if (deadlineDuplicateDetector.checkDuplicates(description, dateOfDeadline, taskList)) {
return"Error. This deadline task already exists.";
}
newTask = newDeadline(description, dateOfDeadline);
break;
}
case"event": {
String[] contentParts = content.split(" /from ", 2);
String[] dateParts = contentParts[1].split(" /to ");
Stringdescription = contentParts[0];
StringdateOfFrom = dateParts[0];
StringdateOfTo = dateParts[1];
EventDuplicateDetectoreventDuplicateDetector = newEventDuplicateDetector();
if (eventDuplicateDetector.checkDuplicates(description, dateOfFrom, dateOfTo, taskList)) {
return"Error. This event task already exists.";
}
newTask = newEvent(description, dateOfFrom, dateOfTo);
break;
}
default:
thrownewIrisException("☹ OOPS!!! I'm sorry, but I don't know what that means :-(");
}
taskList.add(newTask);
return"Got it. I've added this task:\n" + newTask
+ "\nNow you have " + taskList.size()
+ " tasks in the list.";
} catch (IrisExceptione) {
returne.getMessage();
}
}
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:
@markgcera 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
Example from
src/main/java/tasks/Task.java
lines8-8
: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)
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/duke/Parser.java
lines26-66
:Example from
src/main/java/workers/AddWorker.java
lines24-75
: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
possible problems in commit
cda1cc0
:possible problems in commit
0e45441
:possible problems in commit
bf03461
: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: