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
@blackpanther9229 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.
publicstaticTaskdecode(Strings) throwsNahException {
if (!checkFirstThreeComponent(s)) {
thrownewNahException.InvalidFileValueException();
}
String[] command = s.split("\\|", 3);
if (command[0].trim().equals("T")) {
assertcommand[0].trim().equals("T") : "the command symbol should be T";
Taskt = newTask.ToDos(command[2].trim());
if (command[1].trim().equals("1")) {
t.mark();
}
returnt;
}
if (command[0].trim().equals("D")) {
assertcommand[0].trim().equals("D") : "the command symbol should be D";
String[] des = command[2].split("\\|", 2);
if (des.length < 2 || des[1].trim().isEmpty()) {
thrownewNahException.InvalidFileValueException();
}
try {
LocalDateTimetime = LocalDateTime
.parse(des[1].trim(), DateTimeFormatter.ofPattern("MMM d yyyy, h:mm a"));
Taskt = newTask.Deadlines(des[0].trim(), time);
if (command[1].trim().equals("1")) {
t.mark();
}
returnt;
} catch (DateTimeParseExceptione) {
thrownewNahException.InvalidFileValueException();
}
}
if (command[0].trim().equals("E")) {
assertcommand[0].trim().equals("E") : "the command symbol should be E";
String[] des = command[2].split("\\|", 2);
if (des.length < 2 || des[1].trim().isEmpty()) {
thrownewNahException.InvalidFileValueException();
}
String[] time = des[1].split("\\|", 2);
if (time.length < 2 || time[1].trim().isEmpty()) {
thrownewNahException.InvalidFileValueException();
}
try {
LocalDateTimestart = LocalDateTime
.parse(time[0].trim(), DateTimeFormatter.ofPattern("MMM d yyyy, h:mm a"));
LocalDateTimeend = LocalDateTime
.parse(time[1].trim(), DateTimeFormatter.ofPattern("MMM d yyyy, h:mm a"));
assertstart.isBefore(end) : "Start time must be before End time";
Taskt = newTask.Events(des[0].trim(), start, end);
if (command[1].trim().equals("1")) {
t.mark();
}
returnt;
} catch (DateTimeParseExceptione) {
thrownewNahException.InvalidFileValueException();
}
}
thrownewNahException.InvalidFileValueException();
}
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.
/** * Return a LinkList of tasks extracted from the file at filePath (helper method). * * @return a LinkList object * @throws NahException if something wrong with the filePath */
Suggestion: Ensure method/class header comments follow the format specified in the coding standard, in particular, the phrasing of the overview statement.
Make Nah chatBot more user friendly by opening a new
Help Window when taking certain input
To do this, let's,
* Create a new class HelpWindow extends Anchorpane
* Create a class HelpWindowResponse to handle input from
HelpWindow
No blank line between subject and body
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).
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:
@blackpanther9229 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
No easy-to-detect issues 👍
Aspect: Method Length
Example from
src/main/java/nah/parser/Parser.java
lines42-179
:Example from
src/main/java/nah/storage/Decoder.java
lines34-96
: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
Example from
src/main/java/nah/DialogBox.java
lines85-90
:Example from
src/main/java/nah/DialogBox.java
lines95-100
:Example from
src/main/java/nah/storage/Storage.java
lines48-53
: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
possible problems in commit
b71badb
: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).
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: