This dashboard is updated weekly.
@austenjs
(41 comments)1
Agree
2
what if taskName is an empty String ?
3
Huge assumption, might tell the UI to print like "no deadline given, midnight is set to be the deadline time"
4
might give StringBuilder a function to handle adding line?
5
give to DukeException?
6
give to DukeException?
7
use i + 1 instead j make it looks cleaner
8
can make it private final ?
9
what if a task that has been done, is invoked with markAsDone again? exception
10
might name it addTask
11
might name it getTask
12
might name it removeTask, and what if index > 0 or index > tasks.size() ?
13
prevent using wildcards for importing packages
14
"The done index is missing."
15
give to DukeException might be better
16
give comment on why id - 1
17
what if index out of bound ?
18
why have 2 attributes for the state of task object?
19
Maybe can give comments? A little difficult to understand the code
20
try to avoid returning null
21
rename it into getTasks might be better
22
rename it into addTask might be better
23
rename into deleteTask might be better
24
Maybe can let UI handle the String format
25
why there is a newline?
26
personally i handle all printing with ui, but it's up to you
27
can add comment so people understand why index reduced by one
28
i used final modifier for my attributes, but I think it's totally fine
29
what if the task has done? throw exception
30
what is \u2713 and \u2718 ?
31
prevent using wildcards for importing
32
delete commands
33
Maybe can let UI handle the printing?
34
minor, but what if the list is empty ?
35
what if a done task is invoked with markAsDone again? exception
36
magic string can be set as static variable
37
as the textbook mentioned, avoid arrowhead style code
38
why limit the size to 100?
39
can use task instead of t for readability
40
avoid using null, can set it as an empty arraylist
41
Great job! I like it 😃
@godjuansan
(33 comments)1
For better quality, should make the boolean isExit to be private attributes of Duke class
2
Should not declare it to be empty string here
3
This is also not a good practice
4
Should explain what happens here.
5
Missing curly bracket
6
What is parts[0]? Abstract more
e.g. String command = parts[0];
if (command.equals("T")) {
...
}
7
Also missing curly bracket
8
Curly bracket
9
Abstract more. What is parts[1]?
10
After reading this part, only then will I understand that | is the delimiter that you put to differentiate each component of the command. Should explain it clearly in the comments
11
Should use UI class to print
12
Same. Use UI class to print instead of doing it directly here.
13
print using the UI class
14
Again, print using the UI class
15
Maybe we can separate LocalDate and LocalTime to make it better
16
Curly bracket
17
Create other class named CommandsEnum and put this there
18
variable name could be better
19
Name is not descriptive enough. Should be Parser parser = new ...
20
Same. Should be Command command = ...
21
Looks a bit long, but barely below the soft limit, 108 chars. Place line break in order to be more readable
22
Deadline deadline = new ...
23
This one is also barely below soft limit of characters. Place line break to improve readability
24
Event event = ...
25
Name not descriptive enough. Should be Pattern pattern = ...
26
Name not descriptive enough. Should be Task task ...
27
Name not descriptive enough. Should be Matcher matcher ...
28
Name not descriptive enough. Should be ToDo todo = ...
29
Name not descriptive enough. Should be Event event = ...
30
Name not descriptive enough. Should be Deadline deadline = ...
31
Same here.
32
More descriptive variable name (e.g. convertedTaskList)
33
Name more descriptive
@ljhgab
(31 comments)1
Although all the three classes in task package are used, perhaps listing them out explicitly will comply with the coding standard better? 🤔
2
According to our coding standard, perhaps there should not be spaces before each "case"? 🤔
3
Perhaps the naming here could be even more straightforward? e.g. formatInFile.
4
Good naming for method!
5
If it is a "TaskList", perhaps can rename the variable name to "tasks"? 🤔 (same applies to the rest methods)
6
Perhaps more Javadoc comments could be included? 🤔
7
Perhaps there should be a space between "Parser()" and "{"? 🤔
8
Perhaps there is a missing space? 🤔
9
Perhaps there is a missing space? 🤔
10
Perhaps there are more spaces than usual? 🤔
11
Perhaps there is a missing space? 🤔
12
Perhaps there is a missing space? 🤔
13
Perhaps there is a missing space after "if"? 🤔
14
Perhaps there is a missing space? 🤔
15
Perhaps there is a missing space after "if"? 🤔
16
Perhaps there is a missing space? 🤔
17
Perhaps there is a missing space after "if"? 🤔
18
Perhaps there is a missing space? 🤔
19
Perhaps there is a missing space? 🤔
20
Perhaps there is a missing space? 🤔
21
Perhaps there is a missing space? 🤔
22
Perhaps there is a missing space? 🤔
23
Perhaps there are missing spaces from this line onwards? 🤔
24
Perhaps there are missing space from this line onwards? 🤔
25
Perhaps some Javadoc could be added here for the public methods? 🤔
26
Instead of "taskLst", would it be better if it is named "tasks"? 🤔
27
Instead of "lst", would it be better if it is named "tasks"? 🤔
28
Perhaps constant variable naming could be applied here? 🤔
29
Good use of functional programming!
30
Perhaps can use the naming "tasks"? 🤔
31
Good use of functional programming!
@yaowei-soc
(31 comments)1
Method header comments should start in the form "Reads"
https://se-education.org/guides/conventions/java/intermediate.html#comments
2
Method header comments should start in the form "Writes"
https://se-education.org/guides/conventions/java/intermediate.html#comments
3
Method header comments should start in the form "Creates a new ..."
https://se-education.org/guides/conventions/java/intermediate.html#comments
4
Method header comments should start in the form "Outputs a ..."
https://se-education.org/guides/conventions/java/intermediate.html#comments
5
May want to structure it like "Returns user input from standard input"
https://se-education.org/guides/conventions/java/intermediate.html#comments
6
This line conforms to https://se-education.org/guides/conventions/java/intermediate.html#comments format, but personally I feel that "Returns" would be a better word?
7
This line conforms to https://se-education.org/guides/conventions/java/intermediate.html#comments format, but personally I feel that "Returns" would be a better word?
Additionally, it should end with a full stop.
8
This line conforms to https://se-education.org/guides/conventions/java/intermediate.html#comments format, but personally I feel that "Returns" would be a better word?
9
"Deserializes string into a DeadlineTask"
https://se-education.org/guides/conventions/java/intermediate.html#comments
10
"Deserializes string into a EventTask."
https://se-education.org/guides/conventions/java/intermediate.html#comments
11
"Serializes task into a String."
https://se-education.org/guides/conventions/java/intermediate.html#comments
12
"Marks task as ..."
https://se-education.org/guides/conventions/java/intermediate.html#comments
13
"Serializes tasklist ..."
https://se-education.org/guides/conventions/java/intermediate.html#comments
14
"Deserilalizes ..."
https://se-education.org/guides/conventions/java/intermediate.html#comments
15
Format looks good to me, but perhaps if you have time, you could write a short description of the test cases?
16
Format looks good to me, but perhaps if you have time, you could write a short description of the test cases?
17
Format looks good to me, but perhaps if you have time, you could write a short description of the test cases?
18
Format looks good to me, but perhaps if you have time, you could write a short description of the test cases?
19
Format looks good to me, but perhaps if you have time, you could write a short description of the test cases?
20
Format looks good to me, but perhaps if you have time, you could write a short description of the test cases?
21
"Avoid magic numbers" https://nus-cs2103-ay2021s2.github.io/website/se-book-adapted/chapters/codeQuality.html#avoid-magic-numbers
Might want to use a named constant for this?
22
"Avoid magic numbers" https://nus-cs2103-ay2021s2.github.io/website/se-book-adapted/chapters/codeQuality.html#avoid-magic-numbers
Might want to use a named constant for this?
23
"Avoid magic numbers" https://nus-cs2103-ay2021s2.github.io/website/se-book-adapted/chapters/codeQuality.html#avoid-magic-numbers
Might want to use a named constant for this?
24
"Avoid magic numbers" https://nus-cs2103-ay2021s2.github.io/website/se-book-adapted/chapters/codeQuality.html#avoid-magic-numbers
Might want to use a named constant for this? Might want to use this style: https://github.com/se-edu/addressbook-level2/blob/master/src/seedu/addressbook/ui/TextUi.java#L25
25
Might want to print an error message rather than printing the stacktrace.
26
Not sure if this is a code quality issue but perhaps you could return a String so that the Ui can deal with the printing to display?
If I remember correctly, this would be part of OOP's SOLID principle: https://nus-cs2103-ay2021s2.github.io/website/se-book-adapted/chapters/principles.html#solid-principles
Currently your TaskList handles the logic and the printing which violates SRP.
27
Should have a space between , and DateValidation
28
Nice! I didn't know you could use this to test the output stream!
29
I am not sure if this is a code quality issue, however, I would recommend using this.task
rather than using this.getTask()
. This is because this.getTask()
does the same thing as this.task
.
Perhaps if your getTask
method does extra processing for the String that is returned back then it would be justifiable?
30
May want to use a static variable for "MMM dd yyyy"
31
May want to use a static variable for "MMM dd yyyy"
@markuz5116
(29 comments)1
Perhaps there is a typo for a variable name for deadline rather than deadlline.
2
importing tasks individually can be clearer.
3
Perhaps having a method name that briefly describes what it does would be clearer.
4
Not sure if I liked that the - does not have whitespace before and after it.
5
I would personally an access modifier for my method to show whether it can be used outside the package or class.
6
Perhaps instead of lst, using tasks could be clearer to know what the list contains.
7
perhaps rather than inputArray, you can have a plural form of the input to show that it has multiple parts.
8
perhaps extracting all the code that deals with different types of tasks could make your code clearer.
9
I like the name of this boolean, clearly tells me what it does.
10
Perhaps FXMLLoader should be camel-cased to FxmlLoader
11
Perhaps the variable name can be more descriptive than ap, so that it will be easier to know what it is down the code.
12
perhaps using plural form will be clearer.
13
I like this variable name, it is clear what it is.
14
perhaps t can be more descriptive.
15
I like the usage of newTask, it makes it clear that this is not in the tasks.
16
i like targetTasks, easy to understand that its a lot of targetted tasks.
17
Personally, I would use tasks rather than taskList, as taskList contains multiple tasks.
18
Perhaps it would be good to describe what 1 meant by introducing a constant, maybe DONE_MIN_ARGUMENTS.
19
Perhaps calling it inputs could be clearer since you are splitting the input.
20
I would personally extract the individual cases codes to different methods such that it will be clearer for readers.
21
Perhaps declaring what each index of the taskTypeSplit is could be clearer for readers.
22
Perhaps declaring what taskString[0] is could make it clearer for readers what it is being compared to.
23
Do you think that extracting the codes for converting the data file to its tasks could be clearer for the readers?
24
Perhaps extracting the data representation to specific task classes could make your code clearer.
25
Perhaps a more descriptive variable instead of d can tell readers what the input is?
26
I like this form of splitting the statement!
27
Perhaps instead of done, a variable name for the boolean could be better as isDone?
28
Perhaps showing what you are checking for in each case could be clearer?
29
Maybe rather than t, using task could be a more descriptive name?
@w2vgd
(29 comments)1
Perhaps use a camelCase variable name and a more descriptive name rather than UC
here?
2
Should this import statement be listed explicitly instead?
3
Same issue as above
4
Perhaps this instance variable should be declared final instead? (as your variable name is already in all uppercase letters)
5
Like the use of assertion here 😄
6
Should there be a space between Exception
and the opening bracket {
?
7
Should there be a space between DukeException
and the opening bracket {
?
I noticed the same issue in several other places too.
8
Perhaps you can remove the unnecessary this
here?
9
Should this method be named differently because markDone
does not really tell us that a task will be returned?
10
Perhaps remove the redundant this
here?
11
Should the name representing packages be in all lowercase instead?
12
Should there be an empty line between the description and parameter sections?
13
Should the breaks be before the operator instead? (Should the +
be on the next line instead?)
14
Perhaps the method name should be more descriptive of the action? (such as printSeparatorLine
)
15
Should this import statement be listed explicitly instead?
I noticed the same issue in several other places as well.
16
Perhaps the break should be after the comma instead?
I noticed the same issue in several other places too.
17
Should msg
be a standard word instead of a "texting-style" spelling as it is part of the javadoc and is meant for users to read?
I noticed several other places with this issue too.
18
Perhaps try to avoid deep nesting and code duplication here by instead using an outer try catch
block that catches the same DukeException
that each if
clause throws?
19
Perhaps use a more descriptive name other than tk
?
I noticed several other places using this variable name as well.
20
Should there be a description for the return value here?
21
Perhaps avoid using a magic number and use a named constant for comparison here?
22
Perhaps make the code more obvious here by adding parentheses around the same grouping?
23
Perhaps remove the redundant this
?
I have noticed several places with this issue too.
24
I like how you make the happy path prominent instead of redundant else
statements 👍
25
Perhaps use a constant here instead of a magic number 4
to make it clear what it means?
26
Similarly, perhaps you can use a constant here instead of a magic number 6
?
27
Should workingDirPath
be in SCREAMING_SNAKE case?
28
Perhaps a more descriptive variable name for mapper
to describe what it maps and what it maps to?
29
Should divider
be in SCREAMING_SNAKE case instead?
@deyixtan
(28 comments)1
Should there be an empty line between description and parameter section?
2
Should there be an empty line between description and parameter section?
3
Is this additional blank line necessary?
4
Perhaps write a descriptive header comments for this method?
5
I agree with @jlxw48
6
Perhaps write a descriptive header comments for this method?
7
Perhaps write a descriptive header comments for this method?
8
Perhaps write a descriptive header comments for this method?
9
Perhaps it could be named as displayList
?
10
Should there be an empty line between description and parameter section?
11
I agree with @jlxw48, perhaps you could further abstract this method?
12
Should there be an empty line between description and parameter section?
13
I think it doesn't really format text per se. Maybe naming it something like printSeparator()
would be better?
14
I think this method should be named to sound like a boolean?
15
Should there be an empty line between description and parameter section?
16
Should there be an empty line between description and parameter section?
17
Should there be an empty line between description and parameter section?
18
Should there be an empty line between description and parameter section?
19
Should @param
and @return
be included?
20
Is it too descriptive? Perhaps have it more concise?
21
I noticed some methods did not have Javadoc comments. Perhaps, you could add them in?
22
I agree with @georgepwhuang. Perhaps you could include them in?
23
I think the @return
is missing?
24
Did you forget to include the @param
and @return
?
25
I noticed some methods in multiple files that followed the same Javadoc format. Should there be an empty line between description and parameter section?
26
Perhaps can name it like markComplete
?
27
I think the method name should be in a verb form?
28
I agree, should it be converted into a verb form?
@vevek
(27 comments)1
Perhaps deadline in the constructor parameter be written as "deadline" instead of deadLine.
2
Perhaps h_rule can be renamed as HORIZONTAL_LINE_RULE. Perhaps it can be made a constant and hence named in all caps.
3
Should raw_in be named as rawIn or rawInput instead?
4
As mentioned by DrWala, perhaps "seq" can be renamed. What does "seq" stand for over here?
5
Perhaps a gap between the statement seq++ and the if statement would make it easier to read. I noticed this elsewhere too.
6
Perhaps "seq2" here can be renamed to secondSequence as it would make it easier to distinguish from the above statements.
7
As mentioned by DrWala, I think case statements should not be indented, but rather inline with the switch statement. Please check again. There's a setting in the IDE to make it easier for you to auto format in the future too!
8
Should "res" be named as "result" over here? It might make it easier to read.
9
Would it be better to have a gap between the scanner statement and the while loop statement? It might make it easier to read. I noticed this in a few other places too.
10
Should the * import can be replaced with the individual required imports? I think it was in the coding standard guidelines.
11
Should the * import can be replaced with the individual required imports? I think it was in the coding standard guidelines.
12
Should the extra lines between the statements and the method braces exist? It might make the code a little harder to read.
13
As above, perhaps some of the extra lines between statements can be removed and the statements can be grouped instead. What do you think?
14
Would it be better to rename isExit to hasExited or something else? I'm not too sure what it refers to.
15
Perhaps the code here can be replaced with a switch statement to improve readability. What do you think?
16
Should there be an extra line here? Noticed it in a few places.
17
I've noticed these lines being repeated in a few of the executeXXXXXCommand methods. Perhaps it would be better to abstract them out to make the overall code cleaner.
18
Perhaps these bunch of lines can be abstracted out too as well. They appear repeated in the other executeXXXXCommand methods as mentioned above.
19
Should there be an extra line before this line?
20
Perhaps the method name "save" could be renamed to "saveTaskList" or "saveToHarddisk".
21
Similar to the previous comment, perhaps "load" can be renamed to "loadFromHarddisk" or "loadTasklist".
22
Should this extra line be removed?
23
Should the * here be replaced with explicit import statements? I believe it's part of the coding standard.
24
Would it be better to rename "lst" to "list" here? Might be more understandable in the areas where it is used.
25
Since these enums are constants, should they be in upper case?
26
Would it be better to rename "f" as "file" to make it more readable?
27
Perhaps it would be better to rename AL to arrayList or taskList here.
@arsatis
(26 comments)1
Should this public method have a Javadoc comment above it? 🤔
2
Should this public toString() method have a Javadoc comment above it? 🤔
3
Should this public toString() method have a Javadoc comment above it? 🤔
4
Why is there an extra newline here? 😮
5
Should this public toString() method have a Javadoc comment above it? 🤔
6
Should this public toString() method have a Javadoc comment above it? 🤔
7
I like how you created tests for 4 separate classes 😄
8
Should these variables be capitalized, since they are constants?
9
Should this variable be capitalized, since it is a constant? 🤔
10
Should these methods have Javadoc comments above them, since they are public methods? 🤔
11
I like how you made the checkboxes constants 😄
12
Should this variable be private (with a separate getter method to retrieve this field in the class)? 🤔
13
Should this variable be private (with a separate getter method to retrieve this field in the class)? 🤔
14
Should there be a space after the word 'Task'? 🤔
15
I like how you separated the imports from different packages with a newline! 😄
16
I like how you renamed Duke with another name 😄
17
Should the extra space after 'storage' be removed? 🤔
18
Should the main method have a Javadoc comment above it, since it is a public method? 🤔
19
Should this variable be private (with a separate getter method to retrieve this field in the class)? 🤔
20
I like how named your method in a manner that explains exactly what it does 😄
21
Should this public method have a Javadoc comment above it? 🤔
22
Should this public toString() method have a Javadoc comment above it? 🤔
23
Should these variables be private (with getter methods to retrieve these fields in the class)? 🤔
24
Oh wow this is awesome! I like how you coded this yourself 😄
25
I like how you named your methods as verbs 😄
26
I like how these names are not too long and not too short either 😄
@Tomashiwa
(25 comments)1
Should this be protected or private?
2
Perhaps you can consider extracting all these into their individual Command class?
3
Should this be protected or private?
4
Maybe you can consider converting this into a utility class whereby all the parse functions are static?
5
Isn't this ui unused?
6
Should this be protected or private?
7
Perhaps you can just pass in the ui instance you already created in Duke?
8
Should this be protected or private?
9
Similar to Parser class, maybe you can consider converting this to a utility class with static functions?
10
Maybe you can consider using the faster System.out.printf with formatted string?
11
Should the test be just calling the function? Maybe you can call functions that will invoke the ui showing those messages, then see if your ui actuall respond.
12
Perhaps can keep it as LocalDateTime to be more flexible, instead of having to parse every time
13
Consider removing this extra line break
14
Consider changing it to "Deadline" as class name should be singular noun
15
Consider removing these empty lines after the JavaDoc comments
16
Should it be private or protected?
17
Consider changing it to "Event" as class name should be singular noun
18
Consider removing these extra empty lines
19
Consider adding indentations and removing the empty line below
20
Consider isolating the execution of different commands into their individual Command classes
21
Consider placing TaskList instance outside of the Parser as parsing tend to only involve the translation process from a string into a specific object, in this case, a Task. The collection of tasks should be external.
22
Maybe the conversion of File to Task can be done within the Storage class, so all TaskList has to deal with is Task
23
Consider deleting this line as the empty constructor is implemented by default
24
Consider adding space between toString() and {
25
Consider removing the extra spacing between "Deadlines" and "deadline"
@Cp-John
(25 comments)1
Can make it public I think?
2
Imported classes should always be listed explicitly according to Java coding standard.
3
May combine with the next catch block I think.
4
There should spaces around operators. e.g. tasks.get(itemNo - 1).isCompleted = true;
5
Remember to use a blank line to separate different parts, constructors, and methods according to Java coding standard.
6
Put a blank line to separate constructor from the private fields according to Java coding standard. And I think making the constructor public is better?
7
Import classes explicitly according to Java coding standard.
8
Since there are some many different types of exceptions the method may throw, maybe it is better to create a parent class DukeException of all of them and the method header may be shorter. e.g. public static int dukeRunner(String log) throws DukeException {
9
The body of each case part is so long. I think you may put them into methods which may increase readability of your code.
10
According to Java coding standard, is it better to make it private here?
11
Remember to use a blank line to separate different methods, constructors and parts of your code.
12
Perhaps using switch case rather than if else is more lightweight and readable here?
13
According to Java coding standard, always import classes explicitly.
14
Are there any reasons for not making it private?
15
Pay attention to the indentation here.
16
Can make the Task class abstract I think.
17
Are the blank lines here necessary?
18
Why don't you use the full name parser as the variable name? The same for others.
19
Why do you put a blank line here?
20
Each case block is too long here. Perhaps abstract part of them into methods with reasonable names which increases readability of your code.
21
Remember to always import classes explicitly according to Java coding standard.
22
Perhaps abstracting part of the code into methods with reasonable names is better in terms of readability?
23
If there is an empty block, is it better to comment on it to help others read your code?
24
Perhaps using blank lines to separate different parts of your code is better?
25
You may put a break for the default block to facilitate reading.
@nhzaci
(25 comments)1
I like the use of packages for your project
2
Perhaps you could consider leaving an empty space between imports from different packages?
3
Perhaps you could follow the format below for a ternary operator:
date += i == commandSeparate.length - 1
? commandSeparate[i]
: commandSeparate[i] + " "
4
Perhaps you could consider naming it differently since checkIfExist() sounds like a boolean expression, however, it performs a stateful operation instead
5
Perhaps you could consider adding a description on what gets returned and what triggers the Exception to be thrown?
6
Perhaps you could consider a different name for the Scanner variable?
7
Maybe you could consider a different variable name? Since the variable name of time could mislead another developer to think this is of the LocalDateTime type.
8
Perhaps you could consider adding the private access modifier to your variables?
9
Perhaps you could consider naming the variable name in camelCase instead of PascalCase?
10
Perhaps you could consider adding JavaDoc comments instead for public methods?
11
Perhaps you could consider naming this to sound more like a boolean?
12
Perhaps you could consider adding test cases where you set the index to be out of range as well?? Maybe something like done 200, delete 500?
13
I like that you broke the long String up into several lines
14
I like the abstraction of silentAdd() to add your tasks instead of directly adding into the list.
15
Perhaps you could consider a more descriptive variable name?
16
I like that you split a long String into two lines with the correct indentation.
17
Perhaps you could consider an alternative name to this method? Since getResponse sounds like a stateless getter method, other developers would probably not have expected a stateful operation to be performed.
18
Perhaps you could consider the use of a switch statement here?
19
Perhaps you could consider adding JavaDoc comments to describe what this public method does?
20
I like the naming of this boolean variable.
21
Perhaps the use of constants such as TODO_TASK_INDEX
instead of "magic numbers" would be better?
22
Perhaps you could consider a different method name here since checkifTaskDone sounds like a boolean method, however, it performs stateful operations
23
Perhaps instead of accessing a task attribute directly, you might want to consider using a setter method such as task.setTaskAsDone() to perform this operation
24
I like the naming of this test method.
25
Perhaps you could consider adding test cases designed to throw exceptions, such as done 200 or delete 100 as well
@danielonges
(24 comments)1
Might have meant date
instead of dead
?
2
Perhaps it would be better to just let the child classes that require this variable implement it instead? If not it would be slightly redundant for the other classes to contain it.
3
Might want to declare what the value 4
means? If not will be classified as magic number.
4
Can leave a space between catch (
.
5
Might want to consider implementing an enumeration for the type?
6
Might not be a good idea to return null; could potentially result in NullPointerExceptions somewhere down the line.
7
Might want to leave space between while (true)
8
Could consider using switch statement instead to make the code look cleaner!
9
Might want to use curly braces instead of leaving inline if statements
10
Might have exceeded line limit
11
Might want to include spacing between operators and operands
12
Consider leaving 8 spaces of indentation for line breaks
13
Should this be canTerminate? Might be better to change to reflect boolean variable name
14
Might have exceeded line limit
15
Might have exceeded line limit
16
Might want to consider shifting "+" operator to begin on new line
17
Might have exceeded line limit
18
Might want to consider removing extra space(s) between new Ui()
19
Good use of assertions!
20
Might have exceeded line limit
21
Might want to include spacing in between try {
22
Might have exceeded line limit
23
Clear and concise naming of method
24
Might have exceeded line limit
@JoelHo
(24 comments)1
Should the indent be 8 spaces instead of 9?
2
Should this be broken up? It may be a bit too complicated
3
Should there be a space between the description and params? Seems to occur a lot, but only a minor cosmetic issue
4
Should the appends be broken up? Or perhaps in a newline eg
str.append(t.getSaveString())
.append("\n");
Similar as below.
5
Should there be a javadoc for this method?
6
Should there be a seperation here? All belong to the vergil package so in my opinion they should be together
7
Should there be a default clause to the switch case?
8
Should these fields be final? They are not getting modified (and in fact if they do you might run into issues!) so no harm letting the compiler check for us?
9
Should the tests be in this structure?
10
Should there be javadoc comments for these methods?
11
Should there be a javadoc explaining the class? I notice most of your classes are missing this
12
Should this be listed explicitly? You can change your IntelliJ preferences to do so!
13
Should there be a header comment for this? Same with a few other classes too.
14
Should the + be separated by spaces? A few other instances of this around too.
15
Not a coding standard violation, but this is a cyclic dependency, perhaps there's another way to do this? (Not that this is bad but just a comment!)
16
Should there be a javadoc for this? Then the other commands can inherit the documentation too!
17
Should there be a space before the {?
18
Should the && be surrounded by whitespace? Few more instances in this class with operators
19
Should the else if be on the same line as the close brace? Occurs a few times below too
20
Should the acronym ISO be lowercase (formatDateIso)?
21
Should the variables be private? Getters can be written instead if necessary
22
I like your extended javadocs!
23
Should there be a singular space before { rather than 2?
24
Should tasks be private? It's not used outside of TaskList either
@umergta
(24 comments)1
hmm... Is this necessary??? Or consider using a better variable name??
2
Consider using a better variable name?
3
Consider renaming this method name?? Is there any reasoning for it being run2(...). Else, u should use consider renaming?
4
exec as a variable name, in my opinion, is rather unclear?? maybe it should be a name that can be associated with parser class. e.g. dukeParser haha
5
i noticed that short hand as a variable name was used in most of ur Task subclasses. i feel like you can be clearer on that part even though they are being used in the same class. Just a suggestion 😃
6
You should add a blank line before describing your method headers.
7
I think u might have accidentally added a blank line.
8
Avoid using abbreviations in ur method names?
9
consider renaming the name that is more explicit and applicable to the program
10
U should add a blank line after describing ur method and before the start of describing method headers.
11
Perhaps, a better variable name can be used here instead of by to make it more explicit that its the date/time for the deadline.
12
There are spaces here in the javadocs. Could've been on accident but u should remove it to avoid the docs to look weird haha
13
inconsistent spacing in the method header comments. I think I saw this in other classes as well so please fix them when u can! 😃
14
Good on you for following the guide and adding a default block for good practice!!!
15
I think you should not write "args unused". Consider using the following description instead 😃
"@param args an array of command-line arguments for the application"
16
I am not sure if this is necessary or a mistake, but following what the description of the level A-MoreOOP said, consider intitalizing these objects in the Duke constructor so the main is just treated as a main entry point instead where u can just initialize the Duke object and call the run method.
17
I agree with enhao25! Variable names are important to convey to the reader what your code is actually doing and what the variable is for. Perhaps, consider renaming them to names that fit the context.
18
I think this one can be done better as both the if-blocks have common conditionns. The first condition has an OR condition so maybe that can be used to "differentiate" the exceptions thrown.
19
I agree with enhao25! Although its a very very small issue, it believe it gives off a better impression of your coding 😃
20
Perhaps re-consider the name of this variable to a more descriptive one haha
21
Perhaps consider making this as a constant that can be used with the final keyword and changing the variable name to "LINE_SPACING".
22
great use of the ternary operator to remove a redundant if-else here 😃 Definitely will use this in my project too for these nitty-gritty if-else conditions haha
23
Maybe u should group "junit" imports together
24
i am not sure if it's a glitch on github's part or ur IDE altered the spacings for ur javaDocs but do check it out i am sure this isnt intentional hahaha
@chenzaza
(24 comments)1
toDocreationTest() should be followed by whitespace
2
same as above, whitespace is missing after ()
3
Maybe you can move the last +
to the second line to better fit the coding standard?
4
perhaps for the array to represent a collection of details of this deadline, name descriptions
in plural form is better?
5
agree:)
6
agree with the test method convention:)
7
i like how you separate two append
in two lines👍
8
Here, it would be better to put +
at the start of each line?
9
eventDate
could be used instead of at
maybe?
10
haha interesting greetings from Duke 👍
11
here and in other Command classes, is s
is missing for the verbs
12
Maybe the comment should start with a verb to describe the method?
13
it would be better if you add method header comments for each method 😃
14
The naming of at
and time
could be clearer to make the loops more readable.
15
maybe the name of the ArrayList should be a plural noun i.e. tasks?
16
The naming of by
and time
could be clearer to make the loops more readable.
17
agree
18
is break really necessary here since it only contains one e
? keeping the throw statement one line can make it look more concise?
19
+
should better be placed at the start of a line?
20
what if when the tasklist is empty, but user command list
? Instead of an error message, can a message be generated to indicate there is no task in the list currently?
21
the method name could be findTasks maybe? to make it more specific
22
interesting and useful method!
but the method name remind
can be more specific to better explain the method action.
Also, codes in this method seem too 'clever' which is not recommended according to textbook, so maybe can separate the long-winded filters into different statements.
23
Perhaps dateD
and dateE
can be improved. e.g. deadlineDate
and eventDate
are clearer, more readable.
24
4
seems a magic number. Maybe you can add in comment to explain.
@VRSoorya
(23 comments)1
All classes and public methods need header comments, please check here: https://se-education.org/guides/conventions/java/intermediate.html#comments
You might have missed the space after "," in the input parameters
2
Should there be an empty line here after the comment?
3
This is a good JavaDoc example!
4
You mean returns the command to delete?
5
"Sets" instead of set?
6
Is this line not used?
7
Please use a verb for method names like "getSize"
8
Please remove space after the bracket, should be: ...(IOException err) ...
9
Please use 2 lines instead for long statements like you have done in the last test in DeadLineTest.java
10
I like how you check for invalid inputs!
11
Just curious, why do you choose to use StringBuilder here?
12
Good naming!
13
maybe "task" instead of "single" here?
14
Distinct import statements please 😃
15
According to https://se-education.org/guides/conventions/java/basic.html#comments, please state @return before @throws
16
Good one line logic here. Perhaps using "taskStatus" instead of "status" would make it clearer to the reader?
17
DF1 and DF2 can be more interpretable names. "inputFormat" and "outputFormat" maybe?
18
Another curious question: why LinkedList and not perhaps ArrayList?
19
Since the method only adds one Task at a time, "addTask" would be better than "addTasks"?
20
Did you have a purpose for this class?
21
I see, thanks for sharing!
22
I see where you're coming from now 👍
23
Oooh coding with foresight, that's great!
@IanCKW
(23 comments)1
Should this be isDone
2
Should be a verb right?
3
Should this be in abstract class?
4
should this be named differently?
5
Shouldn't you have javadocs for the most important class (Duke)?
6
According to the 2103T guide, should the descriptions of your tags(@) start with a capital letter? This seems to be up for debate, as the oracle guide and the 2103T guide on javadocs differ.
7
Should your files be in a package so that you can use protected methods instead of public ones?
8
I like how you've abstracted the commands
9
Should you have a finally as best practice? This is fine too.
10
I like your whitespacing!
11
Should you be more specific? run() merely drives Duke, not the program as a whole.
12
Why did you choose to modify toString instead of creating a new method?
13
Is there a better-formatted way of doing this as the number of types increases?
14
why did you choose to use the name "tokens"?
15
I like how this is succinct!
16
Should you have done initialized this earlier so you don't need to keep repeating yourself?
17
Are these empty lines necessary? They don't seem to separate distinct logical blocks.
18
Should you split this into two lines since it is just shy of the character limit?
19
Why \u2713?
20
Should you be capitalizing "A" when the rest of your javadocs have lowercase for the first word of your tag descriptions?
21
I'm not sure if this is an issue with Github, but it's showing me that your indentation for this wrapped line is not 8 spaces
22
Should you be splitting some of this into multiple tests?
23
Same as above.
@ivantjh
(22 comments)1
Comment indentation should be aligned to method code.
2
Pretty long method. Could be good to abstract out the logic for individual case clauses.
3
Should have an empty line between description and parameters.
4
May be better to return tasks
here to avoid using the else clause at the bottom. This will avoid further nesting of code.
5
e.g.
if (myFile.createNewFile()) {
System.out.println(...);
return tasks
}
System.out.println("File already exists");
...
6
Could have line breaks in between to make it more readable for others. More info here.
7
Or put them into their own Command
classes
8
Would be good if the Tasks themselves could parse the string to create back the instance, e.g.
if (type.contains("[T]")) {
Task todo = ToDo.createFromStoredData(type);
} else if (type.contains("[D]") {
Task todo = Deadline.createFromStoredData(type);
} else if ... {
...
}
9
So the code would be more readable 😃
10
No space after output. Should be output = Parser.parse(tasks, input);
11
JavaDoc not following style guide. Should start with a verb. I don't think this is the right comment for the method too. Could be Returns bot's response after processing user input
12
Should be Adds task ...
13
No need new line after JavaDoc
14
Need to have a space before the =
, should be this.type = type
15
Need to have empty line between description and parameter section or else the JavaDoc won't be rendered properly when generating documentation.
16
Need to have space before and after -
.
17
Need to have space before and after +
18
Need new line between description and parameter section
19
Description should start on the line after /**
20
Need to have spaces before and after condition, i.e. if (allTaskMsg.isEmpty()) {
21
Same for here
22
Constant names should be uppercase with underscores to separate words.
@chewterence
(22 comments)1
Perhaps use a more intuitive variable name here such as taskList?
2
Should the bracket and the word 'do' have a spacing between? I noticed this same issue in several other places too.
3
Should there be a spacing between characters in the bracket?
4
I like how you catch each exception separately, however the handling done for each of them appears to be the same function?
5
Perhaps this while loop could start on a new line?
6
Should wildcard imports be used?
7
Perhaps a spacing could be used after the comma in "parseTarget, String delimiter"? I noticed similar issues in other arguments separated by commas in round brackets.
8
Should the +'s be separated by white spaces before an inverted comma?
9
Should comments be indented in the same line as its code?
10
I like how you named the regex String as pattern 👍
11
Perhaps function names should follow camelCase?
12
I like how you have followed screaming snake case for constant names 👍
13
Should a more suitable variable name could be used here? Perhaps singular instead of plural?
14
Perhaps method names should be verbs? I like how it is already in camelCase?
15
Perhaps constants should be in screaming snake case? I noticed the same issue at other parts of your code
16
Perhaps a more intuitive variable name here?
17
I like how your variables are named intuitively 👍
18
Perhaps nesting if-else statements like this might be a little confusing? Maybe consider using a switch case?
19
Should the return result of tasks.getTaskList() be directly passed into writeTasksToFile()?
Perhaps it could be neater to save the variable and pass the variable into the second function, thus sticking to the same level of abstraction.
Maybe:
TaskList t = tasks.getTaskList();
storage.writeTasksToFile(t);
20
I like how this snippet of code is efficiently condensed into a single line. However, perhaps you could expand it into its parts of split, obtaining the value from the array, then applying .strip()?
I noticed this idea could be applied to other parts of your code too.
21
Perhaps a better name for this function would be printTasks()?
22
Perhaps extract out the statement within the parenthesis for easier reading?
@kouyk
(22 comments)1
Preferably java.* should be above any third-party packages
2
Please leave a line break between the description and parameter section.
3
Do you think it will be better to name the String as dataFilePath
?
4
Will it be better if Integer.parseInt(description) - 1
is extracted as a variable first since it will be used multiple times?
5
This is very similar to the event
case, will it be better to extract this as a function?
6
I like how you are using the default
branch to catch errors.
7
The use of this
is to be avoided according to the style guide.
8
Naming the variable as *Of* is rather awkward, do you think dataFile
is simpler and straight to the point?
9
I think this should be lineNumber
right? It is pretty misleading on the first look.
10
Do you mean HORIZONTAL_LINE
?
11
Will it be better to have a default
branch, since String can take on any arbitrary values and no checks are in place to ensure correctness.
12
Do you mean index
of the task?
13
I see that this wraps around every reply, is it better extract this out to avoid multiple statements like this?
14
Extraneous semicolon!
15
Period is a confusing way to describe the number of remaining days, perhaps getDaysRemaining
is a better choice?
16
I assume this method can be made abstract?
17
data
is very vague and not descriptive of the content of this array, maybe entries
?
18
It will be better if there is an empty line between description and parameter section.
19
Please place the line break before the + operator
20
I like that there are no wildcard imports
21
Accidentally left an extra blank line here?
22
Do you think that it is better to name it as setStatus?
@pyuxiang
(20 comments)1
Be careful of the spaces 😉
public void writeTaskToFile(List<Task> tasks){
2
You might have inadvertently added an extra blank line here:
https://se-education.org/guides/conventions/java/intermediate.html#layout
3
The indentation is a little off here: should be in line with the block.
try {
4
The catch
keyword should be in line with the closing brace.
} catch (FileNotFoundException e){
5
Another space missed 😉
while (input.hasNextLine()) {
6
The case
statement should be in line with the switch
, and the case blocks one indentation lower.
switch (s){
case "todo":
System.out.println("____________________________________");
7
Another missing space 😉
8
And another 😉
9
You might have missed this: variable names could do with a more specific name, especially since the scope isn't small. Perhaps s1
can be renamed as userInputLine
.
10
Applies to a couple other lines below.
11
Not a coding standard, but figured I could chip in. Since the catch
block is the same as that below in line 86, you can consider removing the try-except
block here.
12
Note the spaces here as well:
for (int i = 1; i < myList.size() + 1; i++) {
13
Consider adding a couple of class-level comments describing the class.
Might not be immediately clear otherwise what this Database
class is intended for.
14
Your import
statements are very nicely formatted 🎉
15
You have a Ui
object passed to the command, which ideally handles message passing to System.out
.
Can consider offloading these to the ui
instead.
Same as in the other commands.
16
This line here states that DukeException
is thrown, but only TaskIndexOutOfBoundException
is actually thrown.
This will require the stack to explicitly handle the general exception instead of a more specific one.
Consider changing it to the throws TaskIndexOutOfBoundException
?
Same goes to the other commands.
17
I couldn't immediately tell what this error is, perhaps more so from the user perspective.
A more descriptive error message might help, e.g. "Argument missing! Event needs to be supplied a date."
.
18
Should describe what the function is intended to achieve, instead of stating how.
Perhaps, "Passes instruction to main routine to exit the program"
19
It's not immediately clear how the datetime is parsed.
You might want to add in a description of how this parsing is done as well, as an
additional paragraph under the method summary.
20
You probably inadvertently missed out commenting this public class.
@cnlinh
(20 comments)1
isExit
2
You may want to use relative path
3
You may want to abstract each case into a separate method
4
splitInputs?
5
DukeIdkException?
6
You may want to change the constant var name to be FILE_NAME and FOLDER_NAME.
7
I think relative file path is prefered
8
Redundant empty space between ( and !isExit?
9
You may want to change to eventDescriptions.
10
currentTasks and newTasks?
11
You may consider using an advanced for loop here.
12
You may want to change the var name to tasks
13
taskArray or simply tasks?
14
FORMAT_ONE and FORMAT_TWO?
15
PARSER?
16
STEVE?
17
parsedInputs?
18
parsedStrings?
19
TASK?
20
You may want to make them all uppercase
@Stratostorm
(20 comments)1
I think adding an empty line between these logical blocks would help readability
2
Seems a little odd that your package is called ssagit when the application is still called duke.
3
Maybe follow the javadoc style of comments? Use '@param' and '@return', etc.
4
This is really hard to read, why do you need to catch the same kind of exception in so many different places? Maybe there's a way to have only one try-catch block?
5
I think UI should be Ui (lowercase i)
6
I feel these exceptions should be under a different class, like a DukeException suggested in the project guide
7
Whew this is long, maybe try moving some logic to other methods.
8
This doesn't seem like good practice to me, should handle the todo and event in their respective cases I feel
9
Maybe consider moving the printing of error messages to be handled by the UI?
10
Extra blank line here
11
Maybe move "Will print out" to the next line
12
Add an empty line here?
13
Maybe use 'tasks' instead of list.
14
Could add empty line between description and parameters section, here and in other places
15
Would it be better to change 'count' to 'index'?
16
Could add an empty line here between the variables and constructor.
17
I think getNextLine or even just nextLine would be a better name, getLine implies getting a specific line from a line number
18
This method doesn't print the message, just returns it correct?
19
Sorry, I don't get what this does...
20
Maybe move 'Input given will not change' to the same line as 'how function gets executed.' Noticed it in some other places as well
@clarlzx
(20 comments)1
Maybe commandsSplittedByWhiteSpace or just commandsSplitted might be a clearer name?
2
Maybe the plural variable name commands will be better for an array?
3
Perhaps a clearer name would be better, also maybe this string array could be placed in toString() since it is not needed anywhere else?
4
Maybe taskDisplayStr or taskDetailsStr might be clearer in showing this string's functionality?
5
Perhaps naming the methods with this format:
whatIsBeingTested_descriptionOfTestInputs_expectedOutcome
e.g., intDivision_zeroDivisor_exceptionThrown
would better show what is being tested.
6
Perhaps a plural name tasks would be better? Maybe the name "tList" could be potentially confusing as well when referred to further down or in other locations, as it could mean task list or todo list.
7
Perhaps the parameter name could be taskList instead of tasks so as to clearly differentiate between TaskList objects and Task objects or Tasks (list of Task objects).
8
Perhaps this name could be puzzling as readers might wonder what "old" means? Maybe a clearer name would be better.
9
Maybe a name that clearly explains the functionality of this counter would be better? (i.e. what is this counter for or what is it counting?)
10
Perhaps a plural could be used for the variable name of this string array?
11
Maybe end with a full stop for consistency for the description of classes and methods?
12
Maybe tasks will be a better name than taskList?
13
Perhaps isExit would be a better name?
14
I like that the name was capitalized to follow coding standards for constants. 😄
15
I like that constant names have been capitalised to follow coding standards and that Javadoc of class members have been specified in a single line. 😄
16
Perhaps a space can be placed between each section/kind of imported statement, to show ordering and segmentation better?
17
Perhaps todos might be a better name?
18
Maybe a plural variable name would be better for this list of messages?
19
For names of constants, maybe capitalizing and using underscores to separate words would be better?
20
Maybe it will be better to take away the space in front of case clauses?
@jessen11
(18 comments)1
I think ENUMS are better in their own class. Do you have any reason to put these here?
2
I think it is better to list out the imports rather than importing by *
3
Any reason about the usage if-else instead of switch? I think using cases will be nicer.
4
I think writing one lettered variable is not very descriptive. Perhaps you should try more descriptive names such as file and scanner
5
Similar point with the above reviewer, a javadoc would be nice here.
6
Perhaps it is better to make all error messages similar.
7
This line is pretty long. I think you can split this into more lines. I like the usage of one-liner if-else, though 😄
8
I recommend to rename this with isDone to be consistent with the coding standards.
9
Another long line. Also, I recommend using iteration form of for for( >T> i : list)
for better formatting. This method is okay, too.
10
Agreed with the first reviewer. A javadoc to explain specific tasks is good.
11
I think the variable d here is not very descriptive. Please change it into a more descriptive name.
12
This is pretty long for my liking. Maybe you can consider splitting it into two lines.
13
These variable naming is rather confusing. Maybe change it into lists and writer?
14
Should this variable named more descriptively? This naming also appears in many other places.
15
I think you are reusing the arr variable over this piece of code. Maybe can introduce a new variable to make it more clear. This is applicable in many places on this piece.
16
I think its better to name the array resulted by the split() to reflect the delimiters.
17
Maybe rename this into byDate so that readers can understand this should be a date
18
This can be renamed to describe that the task here is a new deadline. This appears in many places in the code.
@AiwassPrime
(18 comments)1
I think the use of * in import statements are not allowed. Please consider listing down everything instead of using *?
2
Maybe you want to try checkStyle? It will adjust the import order to the correct order. But anyway, this course does not specify the import order.
3
According to the coding standard, a line between description and parameters are required. Maybe an empty line here makes it more proper?
Edit: Same for every other javadoc.
4
In the coding standard, there is one line:
In method header comments, the first sentence should start in the form Returns ..., Sends ..., Adds ... (not Return or Returnning etc.)
Maybe you want to change every javadoc starts with verb?
5
I am not sure parameter s is compatible with our coding standard. But a meaningful naming will always make it better. What do you think?
6
addString sounds like a verb instead of a noun. This string sounds like a method instead of a variable.
Edit: okay after reading more of your code, I am thinking this naming might not be wrong.
7
Indentation should be inline with the switch according to our coding standard. I still don't know why they are doing that...
8
Missing something?
9
Missing a space here. Same for the next method
10
Maybe consider changing this main to testMain or something?
11
This method is too long. Maybe you want to abstract something out and cut it down a bit.
According to the code quality chapter in the textbook, a method should not get more than 30 lines.
You may want to check here: https://nus-cs2103-ay2021s2.github.io/website/se-book-adapted/chapters/codeQuality.html
12
Consider extending {} to a new line?
13
Maybe splits instead of split?
14
This comment carries no information. Maybe delete it?
15
The comment should be in a separate line.
16
This is a good point! I am going to change my code!
17
lineGetter is a noun, and we should verb for the method name.
(But I personally also like to use this kind of name. This course has soooooo many strange rules.)
18
I suppose it should be trimWhiteSpaceTest_xxxx_xxxx if I am not wrong?
@mesyeux
(18 comments)1
Perhaps you can phrase your JavaDoc comment in a different way, such as "Adds a Deadline object into the tasks after parsing of execution" and "Raises an exception ..."
2
Just a tiny nitpick, but consider adding a space between your parameters inside functions to improve readability.
3
I like how you're checking for invalid inputs with very specific exception messages! This way the user would have an easy time telling what's wrong.
4
Maybe you could name this boolean as isExit to make it more obvious that it's a boolean variable.
5
Just curious but is there any reason you used LinkedList over ArrayList?
6
I like the very specific class name.
7
Great line break to improve readability!
8
Perhaps consider importing specific packages instead of using the wildcard import.
9
Maybe you could consider using spaces in between the colon to make it easier to read?
10
Perhaps you could be clearer with the naming of this variable, maybe use dateBy
instead of just by
?
11
I agree with this, great suggestions!
12
Perhaps you could consider using a more specific name such as dateBy
so it is clearer to readers?
13
Great indentation to improve readability!
14
Great practice of capitalising the constant variables. Just curious but is there a reason why you chose to use constant variables over enumerations?
15
Perhaps you could specify what this index
is referring to and rename it as such. Maybe indexOfDescription?
16
This looks a little like arrowhead style code. Perhaps you can consider simplifying it so that it's less complicated and indented.
17
Maybe you can consider using Creates instead of Create
18
Perhaps you could leave this JavaDoc comment out, as it seems to be repeating the obvious.
@seaniy
(17 comments)1
Would variable name for boolean isDone be better?
2
Would containsKeyword be a more appropriate method name?
3
Perhaps joining the separators as a string before and after the msg and then printing the output would be better instead of calling System.out.println() multiple times?
4
Perhaps an empty constructor would be unnecessary to be included as a default constructor can be used instead?
5
Extra blankspace here
6
Perhaps you could standardize if you would like to add a blank line after declaring class or not? I have noticed inconsistencies of blank spaces after class declaration in several other places too.
7
Perhaps you could use LocalDate to store the deadline date for more flexibility
8
Perhaps the use of isSavedBefore would be more suitable as a boolean variable name?
9
As there is only one parse(str) method available in the class, perhaps the "this." is unnecessary?
10
Should remove unnecessary whitespace/blank lines
11
I noticed similar issue in several other places
12
For @return tag in javadoc, should include description on what the method is returning
13
Consider adding a space before the opening braces
14
Consider adding a space before the opening braces. I have noticed the same issue in several other places too.
15
Empty constructor is unnecessary.
16
Should take note to avoid adding additional/unnecessary whitespaces in your code, such as the double space in "Deadlines deadline = "
17
I like the name you have chosen for your chatbot
@lirc572
(17 comments)1
The coding standard says:
Write descriptive header comments for all public classes/methods.
Although I agree that there is nothing much to write about here, it would be nice to still have a JavaDoc comment for it 😄
2
Same as above, maybe it would be better to add a simple comment like Constructs a DukeException object
.
3
Header comment can be added here
4
Header comment can be added here
5
Header comment can be added here
6
Header comment can be added here
7
Header comment can be added here
8
Header comment can be added here
9
Header comment can be added here
10
Header comment can be added here
11
Header comment can be added here
12
Header comment can be added here
13
Would it be better to use a more descriptive name for this variable?
14
Perhaps str
can have a more descriptive name like taskDescription
?
15
Same as above, maybe str
can have a more descriptive name?
16
Perhaps this method can be renamed to markAsComplete
?
17
According to the coding standard,
No blank line between the documentation block and the method/class
@rachelljt
(17 comments)1
Shouldn't the import statements be arranged in lexicographic order?
2
I think it is better to store the horizontal lines as a constant as a final variable.
3
I think the empty lines should be deleted to make the code neater.
4
Should be in lexicographic order.
5
i think its better to have a line separation here
6
Naming of variable should be meaningful. Perhaps you could change to it to myTask instead, similar to the one above(ArrayList>Task> tt)?
7
Similar to the one above, it should be arranged in lexicographical order
8
i think the empty line here should be removed
9
I think there shouldn't be an empty line here
10
Should this be written as checker = 1 instead?
11
i think there should be an empty line between the description and the parameters
12
same for this, i think there should be an empty line.
13
Is the line a little too long? I think its better to split into 2 parts.
14
I think this empty line here should be removed to make the code neater.
15
Should the println statements be shifted into the UI file?
16
Should n could be changed to index to make the var name more meaningful?
17
Should the println statements be shifted into the UI file?
@daniellau88
(16 comments)1
I think you may have forgotten to resolve the conflict here?
2
The conflict here seems to be unresolved too
3
Would getTaskCountMsg()
be a better name to make it consistent with the other method's namings
4
Would it be better to implement the class as a concrete class instead? The intention of an interface is to act as a contract.
5
Maybe you would like to rename it to a more informative name, e.g. argumentsFromInput (might not be the best name, but I can't really think of other alternatives)
6
How about using the pair words key and value, since they will be used in a HashMap
7
Should this be @Test
(looks different from the rest)
8
Not sure if you want to include the package name in the README.md
title folder. The change is possibly due to Intellij's refactoring
9
The path currently is not valid, i.e. there's no file duke.Duke.java
so you might want to change it.
10
I think it would be good if you added the Javadocs
to the classes
11
Would it be better to indicate that the two index
's here are of different types? I was a little confused as the index which is the class attribute was of int
.
Maybe it would be better to specify something like indexString
in order to distinguish the two.
Note: Similar for the other classes using
index
12
I's assume Ack stands for acknowledge, but would be clearer to rename it to something like printTaskListStatus
?
13
I think it would be more informative to name the string as errorMessage
, so that it would be easier for others to understand the purpose of the string on first glance.
14
Comparing parseInputToDateTime
and parseSaveToDateTime
, Input
is a noun in the first case, but Save
is not a noun. Would it be more consistent if you rename it to SavedInput
?
15
Would it be better to keep it consistent and name it displayGreeting
instead?
16
Same for the ones over here. Would be good if you use a consistent verb (between print
, display
and show
)
@eksinyue
(16 comments)1
Maybe a better alternative for this method name is MarkAsDone
? as names representing methods should be present tense verbs.
2
Do you think a good alternative for this variable name would be updatedTask
?
3
Just a suggestion, but maybe a good practice would be to make tick and X symbols constants. for e.g. TICK_SYMBOL = "\u2713"
and CROSS_SYMBOL = "\u2718"
to avoid having magic strings in the code.
4
Instead of using .substring()
with magic numbers, maybe you can consider using string.split(" ", 2)[1]
to get the string after the first space.
5
I think it would be good to capitalize the first letter of a sentence for JavaDoc comments.
6
I like how you make delimiter a static var to avoid having magic string in the code! 👍
7
Do you think a better alternative for this method name would be isInDescription
?
8
According to Java coding standard, Names representing methods must be verbs ...
. Maybe a good alternative for this method name would be getTaskInformation
?
9
Maybe it would be good to use named constants for "+" and "-" to avoid the use of magic strings in code?
10
Maybe named constants can be used for command tyles and delimiters too to avoid having magic strings.
11
I like how you named messages for different scenarios, which improves the readability of the code.
12
I personally think this method can be slightly too long and has too many responsibilities. In order to follow SLAP closely, maybe you can consider extract the methods to check invalid inputs, perform the task, and print feedback for the task.
13
I like that you updated your project README!!
14
I like that you used a named constant for your delimiter to avoid the use of magic strings in the code. 👍
15
I personally think this method is slightly too long and has too many responsibilities. In order to follow SLAP closely, I think you can consider separate it into a few methods, including createFile()
, readFromFile()
, createTasksFromFile()
, etc.
16
Maybe you can consider making all the messages / strings named constants at the beginning of your class, so that the meaning of each string is well-explained, and it makes your code more succinct and readable as well.
@cheunggalen
(15 comments)1
I like how easy it is to read your code! It is also good that you avoided deep nesting and having an arrow head structure. You did this practice earlier as well so good job!
2
It is good that your boolean variables are named to sound like booleans. I also noticed the same practice in several places such as boolean method names too. Keep it up!
3
It is good that you named collection of objects in plural form. You did this in several other places too. Well done!
4
It's good that your indentation of case clauses follows the java coding standard.
5
Your try-catch statements follows the java coding standards. You also did this for several other places too. Well done!
6
Your if-else statements follow the java coding standard. I noticed that you did this practice for several other places as well. Keep it up!
7
You followed the java coding standards for your package statement. You did this for other package statements as well. Nice!
8
Your imported classes are listed explicitly. You did this for other classes as well. Nice one!
9
I'm not sure if this is considered somewhat of a deep nesting, resulting in a arrow head structure?
10
I like how there is no deep nesting (arrowhead) here!
11
I like how you made the happy path prominent here!
12
I like how you your method name accurately explains to the reader of the method's functionality. Even if it may be long, it is clear.
13
Could this be done in steps? I'm not sure if I like this complicated expression as it makes it harder to read.
14
Could this be abstracted further to follow the SLAP?
15
I like how you split a long line into several short ones to enhance code readability.
@hengyongming
(15 comments)1
Better to separate it into 2 lines
2
May be better to store it in a string variable.
3
There should be a space after "+"
4
searchDate may be a better name
5
Store the lambda inside a function?
6
you could just create an ArrayList at the start to remove repetition
7
Good effort in catering to all possible input. Perhaps what you can do is to just throw an exception if the input is not in the correct format
8
Perhaps can change the attributes to final since it is not reassigned
9
I think description would be a better name
10
Can just return the string directly without storing it in msg
11
Can just return the string directly without storing it in msg
12
Can remove the single line here
13
getCategory() would be a better name
14
Comments can be placed in the javadoc instead
15
Empty constructor is not required
@icytornado
(14 comments)1
maybe can try to put in return type of the function in javadocs?
2
maybe march the codes to the left margin?
3
maybe can add return type of the function into the javadoc? The prob exits in multiple parts of the PRs i think, if am not wrong
4
maybe should leave a line after this line?
5
maybe can try to use more discriptive words, instead of such short word, so that reader can understand what this variable repesents.. this is what i think
6
if i am not wrong. i remember its 4 space indentation for the codes in the function body?
7
should we remove such lines after resolving the merge conflict?
8
can remove this line. same for other parts of the code.
9
i think maybe can delete the blanklines between these import statements.
10
maybe can not more explanatary variable here,
which can better explain the purpose of variable
11
maybe can replace nested if-else with cases, and a default?
12
maybe can leave a blankline after this to group similar codes together for better readability?
13
would it be better to extract out this nested if-else statement,
as a method, so that the reader do not need to trace the code too much?
14
would it be better if a noun is used,
instead of verb. For example, can be taskAdder?
@BenedictBCJJ
(14 comments)1
I'm not so sure for exceptions but class names should be nouns according to the coding standard.
Maybe DateTimeFormatException is better since it already implies that it is invalid/not recognised.
2
Since this is a constant, it should follow the coding standard of all uppercase and using underscore to separate words.
3
Instead of naming inputsAreValid, areInputsValid seem more inline for a boolean return value method.
4
I think 'at' is too short a name for a variable that has a rather large scope, should Event class become bigger in the future it might cause confusion in the future.
Since it might mean time or location.
5
Maybe you can add comments on what this class does?
6
Maybe you can explain that the command interface interacts with the input of the user and how the classes that implement this interface would have what methods in common.
7
Some inconsistent ordering of import statements compared to DeadlineCommand.java
8
Similar inconsistent import statements
9
Maybe updateListInFile is more appropriate and more similar to your other method readListFromFile.
10
I think its better to use numOfTask than plural form since most plural form should be used for some form of collections and not be confused between them.
11
It might be good to separate the imports based on packages so that there is consistency and is readable (coding standard)
12
Same thing about import statements, consistent and readable. (coding standard)
13
I think having a more verbose method name would help in identifying what it does exectly
14
If the class is not storing any variables, it might not be needed to initiate an instance of it, instead, you can just make all the methods static
@marcusleeeugene
(14 comments)1
The class itself looks fine, however I would suggest leaving an extra spacing after each '{' curly bracket openings.
2
It might look better without an additional newline after each try-catch / if-else statement.
3
The new line format used should perhaps be more consistent in the entire codebase.
4
The class itself looks fine, however I would suggest leaving an extra spacing after each '{' curly bracket openings.
5
The class itself looks fine, however I would suggest leaving an extra spacing after each '{' curly bracket openings.
6
Instead of using 'tdStr' to represent task description, maybe you can rename it as 'taskDescription' as it makes the variable more easy to understand.
7
Instead of using 'tatStr' to represent task at, maybe you can rename it as 'taskAt' as it makes the variable more easy to understand.
8
I like how the boolean 'isDone' really does sound like a boolean variable. It is easy to differentiate it from other type of variables.
9
Perhaps it would be better to rename tasks as TASKS since it is a final variable.
10
There is quite some content to go through when looking at these if-else statements. A suggestion would be to use switch cases, and perhaps do a single try-catch block that handles different kinds of exceptions.
11
The variable isDone sounds like a boolean return type instead of a String, perhaps it will be better to rename the variable.
12
It might sound better as a boolean variable if you rename fileExists variable to isFileExist.
13
Perhaps the variable names could be in upper cases, since they are final variables. It might be difficult for one to differentiate the constant variables.
14
Declaration of deleteIndex and count could be placed at the top of the deleteTask method, to easily identify where declared variables are located at.
@icelenaugust
(14 comments)1
Would you like to change the name of the parameter to a more meaningful one!!
2
Would you like to change the parameter name to a more meaningful one such as "commandInput" or "input"?
3
Your Javadoc is really detailed and compete! Good job!
4
Would you like to make isExit a member of the Command class, so that you don't have to override as a method, and can be initialised in constructor!
5
Would you want to change the if-else statement to the switch statement, so it is neater!
6
It is good that you changed the default switch statement format to the one that this module follows!
7
Will it be better if you change the parameter name s to a more meaningful word like "taskName"?
8
Would it be better if you make your class member private!!
9
Maybe it will be better if you name your parameter using a noun such as "date"!!
10
Maybe it will be better if you name your parameter using a noun such as "date"!!
11
Would it be better to put while loop inside the try block?
12
Maybe you wanna change the if -else statement to switch statement to look neater?
13
You may want your class member to be private!
14
It is good practice to check if the path exists before directing to the path!
@JayChenYJ
(14 comments)1
Javadoc comments should start with caps 😃
e.g @param x X coordinate of position. Instead of @param x x coordinate of position.
2
Should not have a space between Javadoc comments and the method. 😃
3
Remember to have a spacing between the method name and the open curly bracket 😃
e.g finish() { instead of finish(){
4
Add a Javadoc comment for this since it is not very obvious what it does at first glance. 😃
5
The method name for this is not very clear, what does it mean by finish()? Perhaps change it to markTaskDone()? 😃
6
Wrong Javadoc comments, should include @return as well. 😃
7
try not to import with *, give specific imports! 😃
8
Remember to leave spacing between the name and the curly bracket! 😃
9
Agree! 😃
10
For this variable, I would suggest to give it a Javadoc comment because it is not very obvious what is it at first glance 😃
11
From the textbook -> Be wary when a method is longer than the computer screen, and take corrective action when it goes beyond 30 LOC (lines of code). The bigger the haystack, the harder it is to find a needle.
I would suggest trying not to put all the logic in here, perhaps can create new methods in this class to handle certain common things! 😃
12
This method is called 'print' but in fact it is adding certain new task to the task list. Perhaps you can try to refactor this method to make it cleaner! 😃
13
Agree! 😃
14
Perhaps you can change this method name to findMatchingItems because findItem makes it sound like you are finding 1 specific item but the return type is actually a tasklist 😃
@xiinweii98
(14 comments)1
Strictly speaking, I remember each sentence should end properly with a full stop.
2
I am pretty sure you can access your private fields instead of going through iceBear.parser
. However, I am unsure which one you should go with.
3
What is the difference between this two methods? I think it would be good to include some java doc comments or make the method names distinct.
4
A switch case should be apt here.
5
I am not sure why you are using java.io.IOException
instead of just IOException
.
6
Is this necessary? What if users choose to input dates in another format? So, I would think it is better to make the user input a certain format like yyyy-mm-dd instead of catering to the different formats that a user can input.
7
I think you can use the inbuilt methods to achieve your desired results. https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/LocalDate.html#format(java.time.format.DateTimeFormatter)
8
It seems like your TaskList is doing the job of Ui returning String objects to be printed/shown to user.
9
A switch case would be apt here.
10
I think it will be good to give the Storage object a proper name.
11
Else, you should probably use a switch case instead of many else if blocks. Remember to indent correctly if you do go with switch case.
12
Nice additional messages
13
Maybe you could retrieve "data/savedList.txt" as a method argument instead of hard coding it right here. So, maybe use the method header instead:
public void exportData(String path) throws IOException
14
You can probably convert type into an enumeration if you want to.
@SoonKeatNeo
(14 comments)1
Perhaps it would be good to see header comments here.
2
Perhaps this could be updated to fileName?
3
Maybe 'isActive' would be a better representation of the boolean nature of this variable?
4
Perhaps Ui or UserInterface may prevent abbreviations from being misunderstood or taken out of context.
5
I think adding header comments in the different files in your project would be helpful to aid readers to understand their main purpose and functionality 😄
6
Perhaps this could also be updated to reflect the boolean nature?
7
Perhaps it would be nice to have some JavaDocs comments reflecting the nature of each method.
8
I like the clean nature of the messages returned! Perhaps the Ui could do a bit less stuff (e.g. find) and abstract out further? (SLAP)
9
Perhaps adding author and version tags to the javadocs may be good as well?
10
I like the clean regex used to filter commands!
11
I also like that you also declared constants to prevent numbers from appearing in the code with no context later!
12
Perhaps it could be standardized to use the "tasks" convention here?
13
Another instance for standardization of taskList
14
I like the verbosity here, although I wonder if it could be made more user-friendly?
@jasaaanlim
(14 comments)1
Even though 'rmb' is just a temporary short-lived variable, would a more readable variable name make things easier for other collaborators and when looking back in future?
2
Could a switch case be a neater alternative as compared to a long list of if-else?
3
I noticed a few repetitions throughout the various classes where you had to use multiple if else statements to display the event type. Have you thought about handling the display of an event type in the respective toString() methods of the Task? Would that be a more efficient way?
4
Noticed that a few of your boolean variables were not named to sound like boolean variables. E.g. the 'first' and 'done' booleans. In this case, would it be more intuitive to name this boolean variable as isDone instead?
5
Is there a reason why you are hardcoding the tabs? Would '\t' may be a neater way of displaying your tabs?
6
I agree with @wangtao0717 on the Duke.java being a little too long, maybe you could look into that.
7
Since you do not plan to use dueDate or taskDescription, could you directly place parser.getDueDate() and parser.getDescription() in the constructor instead?
8
I like how you let the switch cases fall through for commands requiring the same output. Something most people forget about.
9
Would it be better to leave an empty line between the description and parameter section of the Javadocs (increases readability too)? The description should also begin with 'Initialises'. Just to be in line with the module's conventions.
10
Perhaps these additional newlines should be removed to stay in in line with the coding standards. I noticed the same for a few methods as well.
11
Would it be better to use a more intuitive variable name e.g. tasks?
12
Perhaps for greater readability for future collaborations or debugging, the dataSplit could be assigned to multiple variables with a more intuitive name? E.g. taskDescription, taskDeadline
13
Would it be more consistent to rename your Duke class to Duck just to be more consistent with your project name?
14
I agree with @kouyk that the HORIZON
variable could be renamed to something more appropriate and intuitive. You may also want to consider setting it to final since there is no intention of modifying the static string anymore.
@gycc7253
(14 comments)1
If i have a command
'event todo a task /by tmr'
this string contains 'todo' but it is actually event...
i think testing prefix maybe safer?
2
i think over here, by coding standard, the + should be the start of the preceding line hh,
same mistake made bro.
3
could you please double check if static import needs to be imported before non-static, i think so but i am not 100% sure haha
4
public class and methods undocumented bro, small issue, maybe u will do it later haha.
5
i think public constructor needs a documentation also
6
maybe import of java.io should be in front of java.nio/util coz of lexicographic order
7
Doesn't public class need header documentation also?
8
same as above for documentation in my opinion
9
this method needs documentation too haha
10
this deep nested loop can be simplified perhaps? but i actually have something similar myself haha, maybe i should look into it too...
11
do you think this name should be doesFileExisits maybe?
12
I remember the start of method documentation should be third-person singular? like Saves Task list as ....
13
this method needs comment also i think
14
All these public methods not documented sia... are u planning to document them later maybe?
@candyhy
(14 comments)1
Should the this
be removed?
2
Perhaps there should be a space between for
and (
?
3
Should the +
operator be on the next line?
4
Should the +
operator be on the next line?
I have noted the issue in several other places as well...
5
Perhaps there should be a space between Exception
and {
?
6
Should there be curly braces for the if
clause?
7
Should there be a space between for
and (
, if
and (
?
I have noticed this issue in several other places...
8
Should there be a space between operators and operands?
9
Perhaps the indentation for switch
and case
should be the same?
You may find this guide helpful 😄
10
Should there be an empty line separating the description and parameters?
11
Should the redundant this
be removed?
12
Should timeslot
be in camelCase?
13
Should there be a space between switch
and (
?
14
Perhaps entry[2]
should be declared as a variable with a descriptive name for better code readability?
@Nanxi-Huang
(14 comments)1
should for statements have the form: for (initialization; condition; update) { ?
2
should there be one space after for?
3
I noticed the same issue in several other places too.
4
I like how you order the import statements
5
Will it be better if your addItem method is named as addTask instead? I think it may better suit the context..
6
should there be a space after for ?
and should operators be surrounded by a space character?
7
Perhaps typeOfEvent should be changed to a more intuitive variable name? Since a todo is not an event.
8
Please use better variable names. Perhaps a more specific name relating to Todo?
9
I like how similar methods in Ui class have a similar naming format.
10
I like how your ordering of import statements stay consistent throughout the work.
11
according to your ordering of import statements, should there be an empty line between the first import statement and the next 😄?
12
should boolean variables be named to sound like booleans?
13
I like how you name this method readTasks instead of readTask, very intuitive!
14
I like how "tasks" in this class is in plural form.
@edelinetenges
(14 comments)1
Would it be better to name this method "makeSenseOfUserCommand" instead? Other than that, I like how the method name clearly explains what the method does!
2
Perhaps naming this String "output" could be more meaningful?
3
I think naming this variable "taskIndex" or something like that could help improve readability? Especially since you will keep using it repeatedly in the else block below.
4
Maybe it would be clearer to mention in the variable name what parts these are?
For example:
"inputParts" instead of just "parts",
"inputFirstPart" instead of "part1",
"inputSecondPart" instead of "part2"
5
Perhaps replacing "xx" with "localDate" and then replacing "f" with "formattedDateString" could improve readability?
6
I noticed that you are using 2 counters so you named them counterOne and counterTwo. I like the fact that you try to differentiate them, but maybe it would be more intuitive to name them something else?
7
Would it be better to name this "loadFile" instead?
8
Similarly, would it be better to name this "saveFile" instead?
9
This might be minor, but do you think naming the variable as "file" instead of "f" would improve readability?
10
Similar to the file variable naming, perhaps naming the Task "task" instead of "t" could make things clearer as "t" could also stand for "todo"?
11
I like how you labeled the Task here as "task" instead of just "t", it becomes a lot easier to follow!
12
I noticed that earlier you used the variable name "description" for the String array after splitting, while here you also use the name "description" for a String type, I think it might be a bit confusing? Maybe labelling them as "descriptionArray" and "descriptionString" could make things clearer?
13
I think constant names are supposed to be all uppercase with an underscore to separate words? Unless I misread and this actually isn't a constant oops
14
I like how clear all the variable names are!
@wei-yutong
(14 comments)1
this class is rather long, perhaps you could consider abstracting the methods out?
2
delString is not a very intuitive variable name, maybe you could make it more specific?
3
i think the term you meant to use might be "overloaded" instead
4
I think that constants in enum should be in all uppercase, eg "LOW", "AVERAGE" and "HIGH"
5
Did you mean "Overloaded" here as well? I've noticed it in a few other places. Otherwise, as the other reviewer mentioned, overridden methods should tagged with "@Override"
6
perhaps some empty lines could be removed to make the code look more concise. I've noticed this in some other places as well.
7
the switch statement as provided in the coding standard has no curly braces, and an explicit "//Fallthrough" comment should be included whenever there is a case statement without a break statement. it's a minor matter but perhaps you could add this in 😃
8
i agree with the other reviewer, this is much more efficient than the method i used! (explicitly considering the cases of 0 or 1 task)
9
perhaps this comment is incomplete? im not too sure what you mean by "Stage to show"
10
the java coding standard suggests that "The explicit //Fallthrough comment should be included whenever there is a case statement without a break statement.", perhaps you could consider adding it in!
11
i agree with the other reviewer on using "commandDetail" instead
12
this is a smart way of identifying done and delete tasks ! 😃
13
very clear and efficient Exception class 😃
14
perhaps this line could be broken up for better readability
@douglaswja
(13 comments)1
My understanding of the CS2103 Java Coding Standard is that Javadocs should end with */
rather than **/
.
2
2 points:
There should be an "Empty line between description and parameter section" - CS2103 Java Coding Standard.
There should be "Punctuation behind each parameter description". I.e. Lines 12 and 13 of Deadline.java should end with a period, as shown below.
Consider the following Javadoc:
/**
* Constructor of a Deadline task.
*
* @param desc Description of the deadline task.
* @param deadline Deadline of the deadline task.
*/
3
The line break here uses 12 spaces instead of the required 8.
4
The line break here uses 12 spaces instead of the required 8.
5
The CS2103 Java Coding Standard gives the following examples of acceptable ternary statements:
alpha = (aLongBooleanExpression) ? beta : gamma;
alpha = (aLongBooleanExpression)
? beta
: gamma;
Consider enclosing the boolean term within parentheses, as in the following:
String keyword = (firstSpace == -1) ? fullCommand : fullCommand.substring(0, firstSpace).toLowerCase();
6
Could consider ending the last case statement with a 'break'.
From the CS2103 Java Coding Standard:
The explicit //Fallthrough comment should be included whenever there is a case statement without a break statement.
Rationale: Leaving out the break is a common error, and it must be made clear that it is intentional when it is not there.
7
From the CS2103 Java Coding Standard:
Here are two acceptable ways to format ternary expressions:
alpha = (aLongBooleanExpression) ? beta : gamma;
alpha = (aLongBooleanExpression)
? beta
: gamma;
Could consider placing the parentheses around the isDone clause rather than the whole return term.
8
Consecutive line breaks should have an additional 8 white spaces.
Example from CS2103 Java Coding Standard:
method(param1,
object.method()
.method2(),
param3);
Note the 8 white spaces preceding object.method()
and 16 white spaces preceding .method2(),
9
Could consider ending the Javadoc summary statement with a period as was done in other Javadoc summary statements in this PR, for consistency.
10
Each consecutive line break for the same line of code should be indented by an additional 8 whitespaces.
Consider replacing lines 49 to 51 with:
dialogContainer.getChildren().addAll(
DialogBox.getUserDialog(input, userImage),
DialogBox.getDukeDialog(response, dukeImage)
11
From the CS2103 Java coding standard, Javadoc should have "Punctuation behind each parameter description -No blank line between the documentation block and the method/class".
I'm unsure if this applies to the first sentence and return type but in other classes of this PR (e.g. Parser.java) the first sentence and return type of the Javadoc both end with a period.
Consistency of punctuation in Javadocs across the various classes might be a way to improve this PR.
Admittedly this is a nitpick.
12
Though you probably already satisfy the "Javadoc more than 50% of public classes and methods" requirements, a useful tip is that by adding Javadocs to a class with methods to be overriden such as the abstract Command class, these Javadocs will appear in Quick Tip windows when users however over overriden implementations.
E.g. Writing a javadoc for getResponse in the Command class will show users the Javadoc when they activate Quick Tip (Ctrl + Q in IntelliJ) for an overriden method in the DeleteTaskCommand class even though there isnt a Javadoc written in the DeleteTaskCommand class.
13
I agree with @jrvslam in that there should be no indentation before the case statements.
If IntelliJ is your IDE, you can follow the instructions at the following link for how to get IntelliJ to follow this coding convention for you.
@xuanqi966
(13 comments)1
Should there be a documentation here to tell us about the functionalities of getSnomDialog?
2
Should there be a documentation here to tell us what does this class represent?
3
Should there be documentations before every class?
4
Concise and clear documentation, really helped me to understand the functionality of this method. Good job:D
5
It would be good to have documentation for every public class
6
Great namings for all these methods, really shows what does each method do
7
Should the switch and case have the same indentations?
8
Great structure of conditional statements and try catch blocks, very clear and concise for readers to understand!
9
Should we use curly braces to enclose the break to improve readability?
10
A pretty long stretch of code, would it be possible to abstract further?
11
Very neat and concise layout, good job!
12
method calls lied out according to similar functionalities, good job!
13
Good use of abstraction!
@DrWala
(13 comments)1
Perhaps the deadline formatting can be abstracted out to a getter, which would make this bit look cleaner. This issue exists in some other parts of the code base too.
2
It might be helpful to remove the else clause so that the core logic is not so deeply nested, and the happy path is more prominent
3
I believe based on the style guides, the case statements should not be indented. Perhaps double-check this?
4
Is there a particular reason you are using the enhanced for loop here? I see that you have an index variable, maybe a normal for loop would then suffice, as the iterator is contained within the loop's scope
5
Perhaps seq
can be a more intuitive name, or a comment explaining what it does would be helpful
6
It might be easier to maintain if the case constants are extracted out somewhere else, either as an enum or some constant variables
7
This might be able to be abstracted out using the String.join
function.
This kind of abstraction may be applicable in a few other parts of the code base too.
8
I see that itemList and fileContents are frequently modified in the same way (addition/update/removal) together, maybe abstracting out to a function would be cleaner and easier to maintain
9
Perhaps it might be more future-proof to use itemList.count()
instead of manually maintaining a count value. Is there a reason you did it this way?
10
Perhaps all the file-based IO can be abstracted away to another class for easier setup/teardown and CRUD operations. Is there a reason to keep it purely within the main class?
11
It might assist readability to break the .append
into multiple lines since they are new lines, and it makes it clear what is being appended to the StringBuilder
12
It might assist readability to break the .append
into multiple lines since they are new lines, and it makes it clear what is being appended to the StringBuilder
.
This specific style issue exists in a few other places too.
13
Perhaps the same breaking into multiple lines argument goes here too to improve readability, and ease of maintenance should the order be changed or new commands be added.
@kangtinglee
(13 comments)1
Instead of getIsBye()
, perhaps isBye()
would be more intuitive and compact.
2
I think you can consider adding the @Override
decorator here
3
I like how clean your driver class is for the entire program!
4
I like the use of regex to parse the input command!
5
Perhaps a switch statement would be suitable here! 😃
6
I like that you've given your bot a name!
7
Should non-constants be uppercase?
8
I think that instead of getIsDone()
, isDone()
would be more succinct and compact.
9
I think that some white spaces can be added here
Task(String name, Boolean isDone) {
10
I think that white spaces can be added here for readability
assertEquals(task.toString(), task2.toString(), "Wrong format");
11
As a suggestion, perhaps define these DataTimeFormatter
patterns as static
and final
constants as they seem to be used quite a number of time throughout your code.
12
I think that it would be a good idea to remove dead code here to better readability.
13
I think that a switch block here would help to improve readability.
@samuelfangjw
(13 comments)1
Perhaps this could be an enumeration instead?
2
Many of your cases start with command.toLowerCase()
, should this could be abstracted out as a variable instead?
3
This method seems a little long. Would it be better to abstract out some of the logic into other methods instead?
4
Perhaps this response could be added to your PrintText class?
5
Perhaps this should be 4 spaces rather than a tab? I noticed you used tabs for indentation in some of your other classes too.
6
Perhaps there should be an empty line between description and parameter sections, as well as punctuation after each parameter description? I noticed this in your other javadoc comments too.
7
Perhaps there should be a javadoc comment here?
8
Perhaps while should be followed by a whitespace character?
9
Perhaps these lines should all be indented at the same level?
10
Perhaps there should be a javadoc since this is a public class? I noticed the same issue in some of your other classes too.
11
Perhaps list should be in plural form?
12
Perhaps the first word of the javadoc should be Returns?
13
Perhaps the name of the method should be a verb instead? I noticed some of your other methods have the same issue.
@jay9645
(13 comments)1
I think it was a good idea to separate the project into task and body packages, but according to the module's coding standard, names representing packages should all be in lower case
2
You may consider writing your variable names in camelCase? So perhaps userCommand instead of usercommand
3
According to the module's coding standard, there should not be an indentation for case clauses
4
Since logo string is a constant, you can consider making it uppercase as per the module's coding naming standards
5
Hi, according to the module's coding standard, single statement conditionals should still be wrapped by curly brackets
6
I was wondering if it is bad practice to leave the catch block empty? Maybe you can consider adding a statement to print the error message.
7
Is it possible to make this protected? The coding standard says class variables should not be public
8
Since this string is a constant, maybe you can make it static and uppercase?
9
According to the module coding standard, there should not be indentation for case clauses
10
I noticed that you often used the work "process..." when naming your functions. I think process is kinda vague and may confuse the reader. Maybe you can consider a change like convertDescriptionStringTo... instead of processDescription
11
According to the module's coding standards, there should not be an indentation for case clauses
12
Hi, is the exitFlag supposed to be used to check for when to exit the while loop? I was a little confused as the while loop used while(sc.hasNextLine()) and I couldn't find where the exitFlag was used
13
This method is a little long, so perhaps reducing some of the empty lines might improve readability.
@vuminhhieunus2019
(13 comments)1
Missing access modifier for this variable.
2
missing access modifier and Javadoc comment for this constructor.
3
missing access modifier and Javadoc comment for this constructor.
4
Missing Javadoc comment
5
Missing Javadoc comment.
6
Missing access modifier.
7
Similar to Deadline class, this class needs access modifier for the constructors and Javadoc comment.
8
This line should be put before the "import duke.Task" line.
9
Missing Javadoc comment for this part.
10
The plus sign should be put in the next line.
11
Missing Javadoc comment for this class.
12
There should be a space between Exception and {
13
Missing Javadoc comment for this class
@chewwh09
(13 comments)1
instead of using b, you could just use isDone.
2
You could have a better convention such as dateTime. "by" alone doesn't have any meaning.
3
Should be lists instead of list. Also, the naming convention could have been better, perhaps using tasks is better? After all, your code is being read by many people with different backgrounds. So it would be better if your naming convention is clearer.
4
Your deadline by naming convention should have followed this format as well.
5
You can change the if-else to switch case for better readability.
6
Could have just do for (int i = 1; i >= list.size(); i++)
7
You should catch the DukeException, if not your program would stop running due to the exception.
8
It seems like getStatusIcon() is used in this task class only, hence you can change public to private.
9
Indentation error
10
Maybe could have abstract each if-else statement into functions to increase readability.
11
It seems like your parsing for each command is pretty long. Could have broken down into functions to increase readability.
12
Instead of starr, it should be strArr. It's clearer to the readers this way.
13
Preferably to have methods start with a verb.
@xyzhang00
(13 comments)1
Would it be more readable by adding blank lines around separate logic blocks?
2
Perhaps a name like getTime can improve the clarity?
3
Perhaps using Enums here would be more suitable?
4
Would it be better to remove such comments or elaborate on them so that they are more understandable?
5
The function name is rather self-explanatory. Could the javadoc be removed without losing code quality?
6
Would it be clearer to give the function a name like excecuteDoneCommand? This applies to other command related functions as well.
7
Perhaps deleting old code can enhance readability?
8
Perhaps giving a more descriptive name will be better as this variable is used in later codes? This applies to other areas in the code too.
9
Perhaps a better name would be isTaskDone?
10
Might be better to add a line between logic blocks to enhance readability?
11
Will it be better to name this like a question (ie. hasKeyword)?
12
Would it be better to add separate the logic block with one blank line? This suggestion also applies to other parts of this file with if-blocks.
13
I like how neat the import statements are 👍
@Cheng20010201
(13 comments)1
LGTM. Perhaps add some javadoc for your public class/methods? (applicable to other classes as well) 😄
2
Maybe can allign the '//' to your code? Like:
// Initialize Task container
ArrayList<Task> tasks = new ArrayList<>();
3
I would say adding an extra while space here?
while (!input.equals("bye")) {
...
4
I guess can try to configure your IDEA to apply the same indentation for switch as in the coding standard?
switch (command) {
case "bye":
// ...
case "list":
// ...
5
Wanna replace i+1
with i + 1
? trivial issue though. 😃
6
I guess a white space can be placed here after catch
, as per coding standards. 🤔
7
Same white space issue as above 😃
8
Like this easy-to-change-name idea! Didn't think of it 😄
9
Handle
-> Handles
🤔
10
I guess can try working on abstracting some methods out? (SLAP) 🤔
Same for below.
11
Love this! Default branch used. 😄
12
The () becomes a bit deep here? I am not sure whether this is related to code quality but I guess can extract out a few lines out of this single line to make it more readable? 🤔
13
Do you think the deleteTask
and completeTask
share some similarities here? What about abstracting something out? 🤔
@hengyiqun
(12 comments)1
Perhaps you could use isDone instead of b, so that it is more descriptive?
2
For greater readability, perhaps you could have a whitespace after the comma?
3
Should there be an empty line before this constructor?
I notice that there are times you leave an empty line before constructors, and there are times you leave out the empty line.
4
Same sentiment as the above!
5
Perhaps you could try having this over two lines?
Quoting the java coding standards:
Try to keep line length shorter than 110 characters (soft limit). But it is OK to exceed the limit slightly (hard limit: 120 chars).
I think the line currently is 110+ characters, but it may improve readability slightly if placed over two lines.
6
Might be good to add an empty line between the class constructor and the method, so that there is better readability?
7
I see an empty line here, but not in your constructors for your other classes. Perhaps you could remove this empty line to make it consistent with the rest?
8
Not sure if you should still keep this commented-out code here since it seems to have already been replaced with an updated version below?
9
I might have missed it, but there doesn't seem to be use of the constant INDENT in subsequent parts of your code. Do correct me if I am mistaken.
10
I like that you made an effort to distinguish between singular and plural tasks! 😃
11
Perhaps you could try exploring the use of "\t" to create tabs, instead of coding the spaces out.
12
I agree with the above. While it is possible to understand currently, the use of String.format()
may improve understandability further.
@litone01
(12 comments)1
Should the class be added or grouped inside a package? This applies to other classes as well.
2
Will it be better to abstract and break this method into many smaller units? It will help in the future also.
3
Will it be better to add javadoc to all public classes and methods? The same applies to all other public classes and methods.
4
Can I check if this import is being used? Because Array should be present by default in Java.
5
so sorry I thought this was my iP, please ignore my replies if any:)
6
Will it be better to remove codes commented out when pushed to master? If necessary, can store them in another branch:)
7
Should it be "Intialises" rather than "Initialise"? A full stop "." is missing at the end of sentence.
8
Should the name of the method be "getTask" or "getTaskInfo"? This is because this method is not "printing" the task information and it is more to return the task information before it gets printed.
9
Very minor point here. Will it be better to change "keyWord" to "keyword" as it is a single word?
10
Should "set" be changed to "isDone" since it is a boolean?
11
Should "done" be changed to "isDone" since it is a boolean?
12
Should the pakage name be more specific? For example, those about UI can be undert the package ui and those about storage can be about storage.
@Sidney011100
(12 comments)1
could the variable "by" have a better and more meaningful name?
2
Overall code is very easy to read. It would be made easier to read if some method and variable names were longer and their short forms were not used, eg "numDone" and "isEmptyDesc"
3
would a more meaningful name be "venue" rather than "at"?
4
I like that the method names in this class are all starting with verbs 😃
5
Would "tasks" be more efficient in telling the reader what the content of list while reading the code?
6
im not sure, but the eg given in Java coding standards seems to do something like (isDone) ? "X" : " ";
7
could there be a more meaningful variable name as compared to "by"?
8
maybe str could be changed to action to prevent the use of shortforms, and for increased readability
9
Overall very easy-to-read codes, however would explicitly writing out the variable names like currTask and printErr improve the readability?
10
a bit of an "arrowhead" code here, maybe can create another method for code in the while loop
11
would it be better if each subclass had a create() method?
12
maybe the convention of naming test methods could be checked up
@chesterhow
(12 comments)1
I like that you kept your main class clean and simple!
2
This try-catch section is quite deeply nested. Perhaps it could be avoided by catching the DateTimeParseException
together with the DukeException
in the catch clause below.
3
Perhaps this boolean variable could be better named to sound like a boolean. E.g. shouldExit
4
I think a cleaner alternative to having such a long if expression here would be to use a switch statement instead. E.g.
switch (command) {
case "todo":
// Fallthrough
case "deadline":
// Fallthrough
case "event":
// Fallthrough
cmd = new AddTaskCommand(command, input, tasks);
break;
case "list":
...
5
Might be good to avoid using magic numbers here. Instead of 9 perhaps you could have a constant string for "deadline "
and run the length function on the string?
6
Perhaps a cleaner alternative would be to return expression directly?
return input.equals("list") || input.equals("list ");
7
👀
8
nit: there seems to be a minor typo here with two semicolons
9
Perhaps this method name could be clearer if a verb was used. E.g. markTaskAsDone
10
I'm not entirely sure if this counts as a coding standard violation, but perhaps you could remove the individual braces from each case
statement.
11
I think the ending brace should be with the last line of the statement, instead of being on its own new line. I noticed the same issue in several other places too.
12
Perhaps a better name for the setter method of the isDone
boolean variable could be setDone
@nicholasnge
(12 comments)1
Could consider calling lines() in the greet() method (and other places where you call it) instead of in the main, where lines are very precious. ie. in the greet method:
'greet() {
ui.lines();
...
ui.lines()
}'
2
love the concept of Chat the cat
3
incredible stuff
4
i think its more standard to use the standard for loop in this scenario, even though they do the same thing... so that the code can be less surprising and more standard
5
the structure here is abit hard to follow... since "Please input with this ... " occurs quite alot in the exceptions, maybe can refactor that phrase out of all the exceptions which point to formatting error?
6
seriously very nice docs
7
hmm isnt the standard to capitalize the first words, eg. CreateEvent_NoSpace..._ChatException
8
^*!_ &^%%**$$$$
9
Would it be better to just not set it instead of setting it to null? Just wondering... same for the tempDate below
10
Maybe it would be good to include some short comments on what these variables are doing in the code haha... took me a while to understand the method 😛
11
Just smt to consider: showError may confuse ppl a little since its usually associated with printing to stderr, but I guess its not a big deal at the same time 🤷
12
Not sure if you meant to not capitalize the "the over..."
and also perhaps across classes, might want to standardize the wording for overloaded constructors (eg. with Event class)
@jellymias
(12 comments)1
Should there be a new line here?
2
Some of the new line spacing is a bit inconsistent. Perhaps you can standardize whether you're putting a new line spacing after every curly brace
3
I like how you split up the code into separate lines! Much more readable
4
Perhaps this can be named Deadline instead of Deadlines, since it is a single Task
5
Shouldn't this be clearAllTasks instead?
6
Perhaps can rename this to makeBiggerBox
7
Should name this as an action, like convert
8
I like how everything is packaged! Very neat and clear 😃
9
I like how you split this up into two lines!
10
Perhaps this is a little vague. Could be more descriptive!
11
Is this findString or should it be findTask?
12
I think it could be good practice to add a line spacing between import statements from different packages!
@picasdan9
(12 comments)1
Should you use Egyptian style brackets instead, in line of the module's coding standards?
2
Should the case
clauses have the same indentation as switch
?
3
Shouldn't the indentation be 4 spaces instead of a single tab?
4
Shouldn't the imported classes be listed explicitly, instead of using a wildcard?
5
Should the method's name be something clearer? For example getCommandNameFromToken
6
Should you remove the space after the method name?
Additionally, should you use a more meaningful method name? For example createCommandFromString
7
Should you remove the space after method's name here as well?
8
Should you use Camel case to name this class name, for consistency?
9
Should you remove the space after method's name?
10
Should you have an empty line between the description and params?
11
Should you name the class as a noun instead? e.g. CommandParser
12
Should you name this as saveTask
instead?
@cheeerynne
(12 comments)1
Perhaps it would be better to name this Todo instance as todo instead of t, to improve the readability of the code.
2
Similar to the comment on naming the ToDo instance, maybe it would be better to name this as deadline instead of d. I noticed the same issue in a few other places too.
3
Maybe you can leave an empty line between the description and parameter section to comply with the coding standard.
4
Maybe you can leave an empty line between the description and parameter section to comply with the coding standard. Same for the remaining Javadoc comments!
5
Even though the line length is lesser than 120 chars, but perhaps it is better to keep it short and neat. Maybe you can break at 'throws InvalidIndexInputException....' to improve the readability of the code. Same for other similar methods!
6
There are many parameters to this DeadlineCommand object. Perhaps by breaking after a comma would improve the readability of the code?
7
Should these empty lines be removed?
8
Should these empty lines be removed? I noticed the same issue in a few other places too.
9
Perhaps you can use Egyptian style brackets here!
10
Would this method be clearer to the readers if the method name is named to sound like a boolean? Perhaps a suggestion like 'isExit' would be more suitable?
11
Perhaps you can add a full stop behind each parameter description to comply with the Javadoc comments form! Same for the other Javadoc comments.
12
Would it be better if the imported classes are listed explicitly?
@jaredtengsw
(11 comments)1
The code follows the Java Coding Standard and with good descriptive header comments. Overall, it gives the code really good readability to allow anyone to understand the implementation of the Duke class with ease.
2
A trivial violation of the Java Coding Standards as name is not in camel case. A quick edit should solve it!
3
Code follows the Java Coding Standards and is really readable.
4
Good coding style which follows the Java Coding Standards. Could consider adding header comments for the function methods to improve ease of understanding and readability of the code.
5
Follows Java Coding Standards which is good. A suggestion would be to add header comments to methods being override to improve readability and ease of understanding especially when tenary operator is used which could make it slightly less readable.
6
Similar to Deadline Class. The code follows Java Coding Standards and a suggestion would be to add header comments to methods being override.
7
Code is really readable and follows Java Coding Standards. Could consider adding header comments to the getResponse() method to improve ease of understanding.
8
I agree with @yeoutzer and like how the function names are descriptive and there are header comments to the functions which improves ease of understanding.
9
I like the consistency in the quality of the coding style which adheres to coding standards as well. The header comments are sufficiently descriptive which improves readability too.
10
I agree with @yeoutzer. The function names use verbs which not only follows the quality guideline but makes it easy to understand purpose of each method.
11
I like that you indicate a comment at the side to indicate what unicode symbols will be printed out.
@Ellevy
(11 comments)1
Would it be better if the javadoc comments started with a capital letter and ended with a punctuation? It would also be good if there is a description after "@throws DukeException", perhaps "@throws DukeException If input is incorrect."
2
I think it would also be good to remove the empty line between the javadoc comments and the start of the method.
3
Should this DukeException message be written specifically for creating Deadline tasks? Perhaps you could use the string "The description and due date of a Deadline cannot be empty."
4
Should there be an empty line between the method description and the parameters? Similar to before, it would be good if the javadoc comments start with a capital letter and end with a punctuation.
5
Would it be better to use a more comprehensive name instead of "tl"?
6
I noticed this same coding violation across a few files. Perhaps it would be better to change these javadoc comments to fit the coding standards.
7
Would it be better to create a summary of the method to use as the first sentence? Perhaps the first sentence can be "Initialises Duke with a storage file." followed by the next sentence explaining more about the specifics of the method.
8
Should these descriptions start with a capital letter and end with a punctuation? I noticed this in a few other javadoc comments too.
9
I have seen a few of such javadoc comments and descriptions without punctuations. Should these comments end with a punctuation?
10
Should the first sentence be a short summary of the method? Perhaps "Creates dialog boxes to display.", followed by the specifics of the method as Javadoc places the first sentence in the method summary table.
11
Similar to before, would it be better to use a short summary for the first line before explaining the method in detail?
@stein414
(11 comments)1
Perhaps add a JavaDoc for this method? Similarly for other public methods.
2
Perhaps the ()
are redundant and could be removed?
3
Perhaps the this
can be removed since file is not being shadowed. Similarly for other places.
4
Maybe remove the extra {} for the case block?
5
Perhaps Adds
would fit better here? Similarly for other places
6
Perhaps you could abstract the numbers out to a static final variable to avoid magic numbers?
7
Good catch for the bye command to show the message before the program closes
8
Perhaps you should abstract the different commands to their respective functions to avoid the long parse
method.
9
You might want to add a blank line in between the description and @return. Reference for code style here https://se-education.org/guides/conventions/java/index.html#comments
Similarly for all other javadocs
10
Maybe it would be better to call it ìsDone'for boolean variables?
11
Perhaps you should rename the method as the name does not reflect its behaviour?
@JodyLorah
(11 comments)1
Maybe list out all imports explicitly instead of *
2
Maybe add some javadocs so others would know what youre trying to do in this class
3
Nice use of plural since it is an arraylist of tasks
4
Maybe name the boolean as a question isTaskDone
5
I feel dont need to so explicitly show what will be returned since the toString method is quite clear
6
nice use of switch statement to make the code clean 😃
7
nice explaining why you return an empty string
8
Maybe add some javadocs here
9
Maybe change it to isTaskDone since it is boolean naming
10
Maybe just updateItem since it is known ArrayLists are mutable
11
Maybe add javadocs explaining what this class is
@frisciliasultan
(11 comments)1
Perhaps it is 'Creates' instead of 'Create'?
2
... I noticed the same minor grammatical issue in other places too
3
Should this new line be removed?
4
Should these lines between class declaration and constructor be removed?
5
Perhaps Javadoc comments could be added for the constructor?
6
I like how you further extract Command into child classes 😃
7
Perhaps location is supposed to be timing?
8
Should it be in plural form since it is an array?
9
Is it showGoodbye or showGoodBye?
10
Perhaps add javadoc comments for public methods?
11
Perhaps timing should be date so that it is more consistent with the deadline task?
@tjtanjin
(11 comments)1
Perhaps a more intuitive name for this method that clarifies what data and input are being referred to?
2
Perhaps a more intuitive method name that describes what is being operated should be used since list
is generic and could refer to other listings like help options. I noticed the same in several other files as well so it might be good to re-look at class methods that might not be clear in conveying what they do 😃
3
Since this isn't a constructor, setter or getter, perhaps a header comment should be included here?
4
Perhaps the import statements for java packages should come before those of third party packages? I noticed this in the imports of other files as well so it might be good to take a look 😃
5
Would a more intuitive variable name like taskList
or tasks
convey more clarity?
6
Perhaps a verb in front of this method name such as showExitMessage()
would make its function clearer. It might be good to consider the same approach for naming other methods as well to make them all easier to read 😃
7
It might be better to import the classes individually instead of doing a wildcard import 😃
8
Since this isn't a constructor, setter or getter, perhaps there should be a header comment for this method as well?
9
It might be best to capitalise the names of constants even if they are private attributes. I noticed this in several other files too so it might be good to do a quick check on this 😃 For your convenience, the bottom of this quick guide shares how the checkstyle.xml
can be updated to catch these violations 😃
10
Should the import statements for java packages come before the import statements for third party packages?
11
Unless the application is behaving incorrectly with the final keyword, I am inclined to think that capitalizing the instance attributes would be the better option. The final keyword reliably ensures that the state of the attribute is never modified and this seems especially important for the taskList, which should not have a new list object unintentionally overwriting it. I have to admit I am not too experienced with java and have only read up on the use of final recently so I am open to and would appreciate any advice on this as well 😄
@habi39
(11 comments)1
Would it be possible to combine these method calls from ui into one method?
2
Perhaps there may be a better way instead of nesting if else statements, an alternative would be using switch cases
3
JavaDoc can be slightly more descriptive about the workings of this method and what it does
4
This method could possibly be broken up as well and could better adhere to Java Coding Standards
5
Naming conventions can be better adhered here
6
Java documentation clearly defines the method and is very readable! Good job!
7
A clear and concise name for the method! Also a good JavaDoc header that describes this method!
8
According to Java coding standard, is it better to make it private here?
9
Adherence of the java Coding standards! Good Job!
10
Very good separation of imports here
11
Would it be good to have a line break to improve readability?
@GJ0407790
(11 comments)1
Task t = tasks.remove(this.taskIndex)
I think can make this simpler by combining both statements.
2
Can have a space after between Command and {
3
Can explain why the method always returns true. eg So that duke can continue accepting commands. (I understand this after reading the ExitCommand)
4
I think can give a variable to t.toString() to explain whether this is the task description or the string representation of the task.
5
This field should be right after header?
6
Add a header comment to describe the use of this task.
I think can declare Task as an abstract class since there is no Task instance.
7
Can give a more descriptive name, ie what does kw stands for?
8
Is this method a bit too lengthy, can consider extract out the common part of the code.
9
This indentation is off.
10
Add a default case as specific in textbook.
11
I think the method body can put in a separate line so that it is more consistent with other method style.
@nighoggDatatype
(11 comments)1
while (scanner.hasNext()) {
I think you need whitespace around this
2
Same as what now? Please clarify in place
3
} catch (DukeEmptyCommandException e) {
System.out.println(e.toString());
} catch (DukeWrongCommandException w) {
System.out.println(w.toString());
I think adding white space is good practice here?
4
public void sayGreeting() {
I think a verb here is good? Also white space
5
for (int i = 0; i < len; i++) {
int index = i + 1;
Task t = this.list.get(i);
if (t instanceof Todo) {
Todo todo = (Todo) t;
System.out.println(index + "." + todo.toString());
} else if ( t instanceof Event) {
Event event = (Event) t;
System.out.println(index + "." + event.toString());
} else if ( t instanceof Deadline) {
I think you need some white space here
6
I'm not sure whether this is an acceptable break from indentation for wrapped lines having 8 spaces? Also, I would suggest you align the pluses with the equal sign, not with the first double quote symbol
7
I think you might want to separate java.util from java.io? MIght be pedantic.
8
I think you could make the method name less misleading? Right now my first impression is that it performs the first step in all parsing. Perhaps you could rename it to "parseLoadedData"
9
While this is fine, I think you could differentiate this from "parseToStart" as "parseUserInput"?
10
I think you need to make this a verb, perhaps "markTaskAsDone"?
11
Very descriptive name! I like 👍
@branzuelajohn
(11 comments)1
In method header comments, the first sentence should start in the form "Deletes..."
2
returns instead of return
3
should the boolean variable be named isTaskDone instead
4
I agree with Anli and Eriksen regarding this
5
"Sets" instead of set?
6
Are you supposed to add content to this test class file, because this class does not serve a purpose now as it is empty
7
should this be "A GUI for Lihua..." to be consistent with the name you decided to name your bot
8
I agree with this. variable names should be in camelCase
9
Should name boolean variables to sound like booleans i.e hasBy instead of foundBy?
10
@param is missing
11
Should the first sentence of method be "Executes" instead of Execute?
@noelmathewisaac
(11 comments)1
Perhaps you can consider using else if and else statements here instead of a nested if-else to improve code readability? I noticed the same in other places too.
2
I like how you used a relative path here 👍
3
Should this function be renamed to 'replaceResponse' or 'newResponse' to make the intent of the function clearer? I wasn't sure what 'replace; did when I encountered the function in the Parser.java file.
4
Should the logic used extract out the description be simplified to make it more understandable? Perhaps instead of splitting on spaces and combing all the words after todo, you can simply remove the word 'todo' from the String? This will make require only a single line of code and is much more compact.
Something like:
String description = line.replace("todo", "").strip() //.strip() is to remove trailing spaces
The same can be applied in other parts of your code for descriptions of deadlines and events.
5
I like the intuitive naming of all the functions in this class.
6
Perhaps you can consider abstracting away the formatting/extraction of dates/times by creating a separate class for functions related to these? There are a lot of variables declared here and abstracting these details will make the code easier to understand.
7
Should you leverage the LocalDate or some other library to convert the date and time format? I feel that doing so will make the code less cluttered and save you the trouble of writing everything from scratch. This can also be applied to all the classes which inherit from Task.
Maybe consider something along the lines of this tutorial?
8
Perhaps changing the default JavaDoc comments to something better descriptive of getResponse would be clearer?
9
I like how the static variables are used to keep track of the command types to improve the code readability. Perhaps you could consider wrapping all these static variables in a static class to make it a bit more organised.
Something like:
private static class CommandTypes
{
public static final String TODO = "todo";
public static final String DELETE = "delete";
}
10
Perhaps all the nested if-else statements are a bit difficult to read and follow? Maybe you can try using switch statements?
11
I like the intuitive naming of all the functions which makes it easy to understand
@nicholastanvis
(11 comments)1
Should variables that describe a collection values be named in the plural sense?
2
Should there be newlines separating these methods for better readability?
3
Should this method be named with a more suiting name? Perhaps a name that explains why this method has to return an array of Strings?
4
Should this constant be named with all uppercase characters?
5
I like how the string is split between multiple lines 😄
6
Perhaps include some whitespaces in the for statement?
7
Should this line of comment start with a third person present tense?
8
You might have forgotten to put a whitespace around the if statement.
9
Should variables which represent a collection of values be named in the plural sense?
10
I like the way this long string is split between multiple lines 😄
11
Should the if statement be wrapped in curly brackets even when they are single statement conditionals?
@github-amanda
(11 comments)1
Header comment is missing for this public method.
2
Header comment is missing for this public method.
3
Header comment is missing for this public method.
4
Header comment is missing for this public method.
5
Header comment is missing for this public method.
6
Comment lacks @param and @return tags
7
@return tag is missing from this comment.
8
Missing @return tag in comment.
9
Can consider changing parameter name to something more meaningful, e.g. "description" 😄
10
Can consider changing parameter name to something more meaningful, e.g. "keyword" 😄
11
Missing @return tag in comment.
@jlxw48
(11 comments)1
Do you think it will be better if you insert a whitespace between ')' and '{'?
2
Do you think it will be more organised if the case blocks are indented at the same level as the switch block?
3
Do you think it would be better to import only the necessary libraries?
4
Remember to include newlines at the end of each file!
5
Did you accidentally leave out the description for the parameter?
6
Just my opinion: any reason why you chose to use a normal class intead of an abstract class? I notice that you never instantiate a Task object in your main code anyway.
7
Do you think this comment is misleading? Since Task cannot be created but rather Task's children classes.
8
Is this lst
variable meant to be accessed outside this class? If not, perhaps a getter method would be more appropriate rather than giving direct access to the other classes, which would result in undesirable side effects.
9
Any reason for the choice of name for this method? The name suggests that it will return Tasks, but instead if gets the lst
and returns it. Would it be more appropriate to call it getXXX
instead? Just some thoughts!
10
Would it be better to split the logic into different methods for better organisation?
11
Do you think it would be clearer to explain that this method is only called when read from storage?
@pasha-292
(11 comments)1
The method here is a bit too long. Would it be possible to make this method slightly shorter by adding helper methods?
2
This method seems too long as well. Maybe you could add the switch case part to a separate part?
3
As others mentioned, perhaps you can rename the variable old to something that could give an indication of what it is used for.
4
Perhaps you can rename the localDate "by" with something that indicates that you are dealing with a local date, since when it is used in a method, we may not immediately understand what it is used for.
5
Perhaps you could have initialized the ArrayList in the constructor since that seems more of a standard practice.
6
Perhaps you could have put an empty space from imports that are from different packages?
7
This method seems a bit too long. Perhaps you could have divided it into smaller methods?
8
Perhaps you could have used smaller helper methods to complete this method? Since there are big chunks of code that can be difficult to follow.
9
Perhaps you could name the method writeTasksToFile instead of writeTasksToFIle? This seems like a minor error in naming.
10
Perhaps you could have named the method findTasks instead of find? Since when you are using it in a different class, it might be difficult to understand what the method does, especially when there is a lot of code.
11
Perhaps you could have named the class TodoTask or just Todo instead of ToDos?
@geraldfan
(10 comments)1
Perhaps this variable name could sound more boolean?
2
Might be better to add a javadoc for this class?
3
Perhaps this method name could be more descriptive?
4
I like how the code has followed the java coding standard.
5
Perhaps there could be a javadoc for this class?
6
Perhaps this variable could be made to sound more boolean?
7
I like how the function name describes what the code does.
8
I like how the variable names are not misleading.
9
I like how the function name uses verbs, as per the java coding standard.
10
I like how the variable names use standard words with no slangs.
@IceBear789
(10 comments)1
Using the wildcard import is discouraged in this module. Maybe you can consider importing the relevant features individually?
2
I've noticed that this file is very long. You may want to consider putting different classes in separate files.
3
The variable "inst" is not clear to me. Perhaps use a clearer variable name?
4
This method feels a bit long to me. Maybe you can consider using helper methods or dividing this method into several smaller methods?
5
I think the variable "fileName" may be clearer here than "fname".
6
This method seems a bit long. Perhaps you can use helper methods to make the code shorter?
7
I've noticed that you have implemented quite a lot of subclasses that inherit from DukeException. Since the only difference between these subclasses are the error message printed, perhaps they can be combined into one subclass? (Together with a new attribute for displaying the error message)
8
Since any task must be either a todo, a deadline or an event, maybe you can consider making this an abstract class?
9
Personally I don't feel that fw is a very clear acronym. Maybe a clearer variable name here?
10
The description for the @param could be clearer. I've noticed the same issue in some other places as well.
@Zaiah0505
(10 comments)1
I think that using switch
and case
would be a lot more readable than if else
statements here
2
May I also suggest switching to a more OOP-oriented code. Perhaps you could create a Task object and extend it from there for each of the tasks and allow each task to handle its own inputList?
3
Maybe you could break this line into separate lines for readability? I noticed lines longer than 100 chars in several other areas too...
4
Perhaps these could be formatted as constants instead and be renamed using capital spelling?
5
I think this line "Pai Kia Bot: no description leh, try again"
could be formatted as a String constant at the start of your code so that it can be reused throughout your program
6
Maybe this comment could be updated to be "blank" instead of "X" symbols
7
Is there any reason why Test methods have underscores for naming convention as compared to regular methods?
8
Not sure what "Ack" stands for
9
Maybe could rename to get TaskListSize() to be more precise?
10
Maybe could rename to findTask() to keep in convention with the rest of your methods?
@glatiuden
(10 comments)1
Java coding standards stated that the imported classes should always be listed explicitly. I understand why you have imported * from duke.command package, but to comply with the guideline, would it be better to import explicitly instead?
2
Do note that there should be an empty line between the description and the parameters. I noticed the same issue in your other JavaDoc comments as well. Perhaps consider configuring your IDE to help with this styling?
3
This line has exceeded the limit of 120 words. Would it be better to separate it into 2 lines instead?
4
Do note that there should be no indentation for case clauses as to adhere to the Java coding standard. I noticed the same issue in the other classes as well. Perhaps consider configuring your IDE to help with this styling?
5
Despite not really violating the coding standards as it only mentioned that variable shouldn't be public, but since other classes or sub-classes are not accessing the keyword
variable, would it be better to declare it as private?
6
Not explicitly stated in the Java coding standard but would it be neater and consistent if there is a breakline between package and import?
7
Maybe the method name can be changed slightly to explain the method more intuitively? E.g. processInputToAction? There should be a space between )
and {
. I noticed this on your other methods and some of the if statements as well.
8
Perhaps a more meaningful name can be given to this variable in order to avoid confusion, and preferably in plural form since it is a String collection? E.g. splitStrings
9
Would it be better if it was isEnd
? For making a boolean variable "sounds like" boolean.
private boolean isEnd;
10
Java coding standard stated that: Single statement conditionals should still be wrapped by curly brackets
. Perhaps you could tweak it a little bit? I noticed the same issue on some of the other if-else statements as well.
@internityz
(10 comments)1
Distinguish clearly between single-valued and multi-valued variables. Use plural instead
2
check the indentation for the codes inside the try-catch statement
3
Indentation for wrapped lines should be 8 spaces (i.e. twice the normal indentation of 4 spaces) more than the parent line.
4
Indentation for wrapped lines should be 8 spaces (i.e. twice the normal indentation of 4 spaces) more than the parent line.
5
The ordering of import statements must be consistent. Maybe add a new line to group them
6
The ordering of import statements must be consistent. Maybe add a new line to group them
7
Indentation for wrapped lines should be 8 spaces (i.e. twice the normal indentation of 4 spaces) more than the parent line.
8
Indentation for wrapped lines should be 8 spaces (i.e. twice the normal indentation of 4 spaces) more than the parent line.
9
Indentation for wrapped lines should be 8 spaces (i.e. twice the normal indentation of 4 spaces) more than the parent line.
10
Indentation for wrapped lines should be 8 spaces (i.e. twice the normal indentation of 4 spaces) more than the parent line.
@kumsssss
(10 comments)1
Maybe you could split them into 3 different lines to make the code easier to understand
2
could try splitting this up into shorter parts so that the code isnt too nested with too many try catch blocks
3
you could consider using a setter to set the attributes of the task
4
should start the + in a new line
5
i would suggest writing writer.close() in a new line
6
method could be rephrased to sound more like a boolean method. Perhaps isAcceptedCommand?
7
Could have thrown the exceptions too
8
comma should be in the successive line instead of the end of a line
9
perhaps you could try using enum. Or since they are constants, let acceptedCommands be in caps like ACCEPTED_COMMANDS?
10
Could have considered the param to be named as taskIndex also to match the class attribute
@lyueyang
(10 comments)1
Perhaps you could have a helper function to avoid deep nesting for better readability 😃
2
Perhaps savedTask would be better as it's a singular File instead of a List of Files
3
Perhaps you could consider having a helper function here too to make it easier to read. Ternary is honestly great and I get an idea of what you're doing though
4
Kind of a long statement here as well, perhaps I would suggest using StringBuilder for better readability 😃
5
Perhaps I could suggest declaring a static final variable to define what 2 is supposed to be here, I believe it's to ensure that there are sufficient arguments but maybe you could name it something like MIN_VARS 😃
6
Perhaps you could have a quick description of this class since it's public
7
Maybe a quick description of the public class here would be good as well
8
Maybe a quick description of the public class here would be good as well
9
Apparently it's discouraged to use public class unless it's a class that's purely for data
https://se-education.org/guides/conventions/java/intermediate.html#variables
10
Same as above on the class being public
@ssoonwee
(10 comments)1
Really like the idea of the use of an interface where you define a template for the classes to follow. 👍
Shutsdown -> Shuts down
2
I think there has to be a new line spacing after a description for the params.
3
I like the idea of serializing the tasks. I am thinking whether would it be good if we can let a separate class to handle the string manipulation, such that the tasklist is only responsible for adding/deleting tasks. Just my thoughts! 😄
4
This is really good. I see that you are thinking of quite a number of scenarios where the tasks are being parsed in and checking their respective output. Keep it up!
5
Parse -> Parses
6
I am thinking for this part, perhaps we can give it to the Parser to do? Just my thoughts 😃
7
Do you think is it possible to break this code into 2? Makes it easier to troubleshoot and for future reuse. 😃
8
I see the parseDeadline
and parseEvent
has quite a number of similarities, do you think can these 2 be placed under one method instead? 🤔
9
Maybe instead of 'One' kind can be 'A'? Just my thoughts 😄
need -> needs
10
I feel the load method could be named more specific such as defining it as loadTasks
, in case if the Storage method has multiple load commands in the future. Just my thoughts 😃
@Eriksen2411
(10 comments)1
I think you want to put "ind" here as indentation. But i think it should be more expressive because it's attribute. Can be "indentation".
2
Also, i do not think that Command class is something that deals with Ui process, cause for this class you are using indentation and line as its attributes, which sounds not like a Command. Just my opinion.
3
Plural form also
4
attribute name should be "taskList" to demonstrate correctly what it means for. Tasks are separate tasks that maybe not related to each other, while taskList is different.
5
this attribute name "isConditionLocalDate" is not expressive i think. As i read this, I cannot tell what is the meaning of this attribute. Is it because of the order of the words.
6
Here the usage of indentation and line seems to be more correct and sensible. However, as i recall, it should not be named "line" and "line2". I mean there is number in it. Should be something without number and more expressive.
7
For me, I think the spacing between consecutive methods is good enough. I just think that at the beginning of the class ( between attributes and constructor) you should leave a one line spacing for easier looking
8
Do we need COMMAND_WORD and MESSAGE_USAGE here at the same time both serving as attributes. I think you should only keep COMMAND_WORD as attribute and the other could be converted to method return.
9
Hmmm i also agree with ZhangAnli this point. and deadlineDate seems good enough.
10
Also agree 😃) Just for me to add 1 comment. TY
@simran-bhadani3
(10 comments)1
Final variables should be written using uppercase.
2
Perhaps you can be slightly more descriptive here and explain what exactly is being saved.
3
Perhaps you can rename this to isFileAlreadyPresent to make it more clear what exactly the boolean checks for.
4
I feel that you can rename ret to something more descriptive which clearly indicates what the array list is supposed to hold.
5
Icon field should be in uppercase since it is a constant.
6
I like how you have inserted a line break here since the line is quite long but the line break should be placed after the comma.
7
Perhaps you can replace scan with scans to ensure that it follows the java coding standard?
8
Perhaps you can name this as isLengthFour to make it sound more like a boolean.
9
You can name the other boolean variables in a similar manner.
10
I think you can include @throws IOException in the Javadoc comment.
@jrvslam
(10 comments)1
should be deadlineTest()?
2
Small thing, but should the tab spacings be 4 space wide?
3
Similarlly, should each tab spacing be 4 spaces wide?
4
Once again, should the tab spacings be 4 spaces wide?
5
Here again too, should the tab spacings be 4 spaces wide?
6
Here too, should the tab spacings be 4 spaces wide?
7
For this class too, should the tab spacings be 4 spaces wide?
8
Similarly here too, should the spacings be 4 spaces wide?
9
switch statements: should each case statement be at the same indentation as switch (i.e no tab before case)?
10
Similarly, should the case statement be the same indentation as switch statement?
@Yanneko
(10 comments)1
Switch case might look better here?
2
Perhaps a more intuitive or descriptive variable name could be used here?
3
Perhaps a more intuitive or descriptive variable name could be used here as well?
4
Perhaps you could add a line in between these imports?
5
Should there be a line separating the imports and your class?
6
Perhaps a more intuitive variable name here?
Similar idea seen in the event task class later.
7
I agree, this will help streamline the Parser's job and respect the abstraction barrier.
8
Should haveWord be hasWord instead? This way it would sound more like a boolean method.
9
Should it be createToDo instead? Considering you used ToDoTask in line 142.
10
Are these breaks needed? I've seen them elsewhere as well. If you are not exceeding the hard 120 character limit maybe these could be in a single line to be a bit more readable? Also the next line should be 8 spaces from the original if you intend to break up a long line.
@Md-Fazil
(10 comments)1
Hey, I like how clean this bit of code is!
2
Perhaps, you could list the classes imported explicitly.
3
Perhaps, the method name can be isIndexWithinRange().
4
Please leave an empty line between method summary and the parameters section. I noticed this issue in several other places too.
5
Please initialize variables where you declare them.
6
Please explain when the exception will be thrown.
7
Hi, I like how clean this bit of code looks!
8
Is there a way you could modularize this further to avoid having a large block of code?
9
Please leave a line between the method description and the parameters section.
10
Please follow the Javadoc format and specify the parameters as well.
@oeiyiping
(10 comments)1
Perhaps you could include an empty line between description and parameter section to comply with the coding standards?
2
Perhaps you could include an empty line between description and parameter section to comply with the coding standards?
3
Perhaps you could include an empty line between description and parameter section to comply with the coding standards? I noticed this in several other places as well.
4
Perhaps you could provide a descriptive header for this method, as well as other public methods?
5
Perhaps you could include a descriptive header for public classes?
6
Perhaps change the description from "list..." to "lists..." for consistency with the rest of your descriptions.
7
Perhaps change the description from "delete..." to "deletes..." for consistency with the rest of your descriptions.
8
Perhaps change the description from "list..." to "lists..." for consistency with the rest of your descriptions.
9
Perhaps rename str to something more descriptive like stringOfFoundTasks.
10
Perhaps rename str to something more descriptive like stringOfAllTasks.
@sylviaokt
(10 comments)1
Perhaps this variable could be named using a noun instead?
2
Perhaps this method could be named getTaskNumber, which is a verb, to better represent the method?
3
Perhaps you could be more specific as to which description is it for?
4
Perhaps specify filePath and folderPath instead? Otherwise it might sound misleading.
5
Perhaps spell out database? DB could be confusing.
6
I like how your method names in general uses verb, and accurately represents their functionality.
7
I like how the method names accurately represent their functionality.
8
Perhaps this variable could be more specifically named? I noticed the same issue under the Events class as well.
9
I like how you consistently place breaks before operators to improve readability throughout your entire code.
10
I like how the boolean method is named to sound like booleans.
@xinweit
(10 comments)1
Should have an empty line between description and parameter section
2
I like that the variables all have camelCase format
3
Space here as well
4
Space here as well
5
Can have javadoc comment for the method here?
6
I like that the method names all start with a verb
7
Maybe can have a more descriptive name than by for LocalDate?
8
Maybe a more descriptive name than at?
9
checkValidDate might be a better name, start method names with a verb
10
checkNumeric might be better here as well
@markmcwong
(10 comments)1
Perhaps naming the method as printLine() since it is not operating on a collection of objects (not lines but rather only one line) and use verb at the start also?
2
Perhaps using a switch statement will be clear and easier to maintain?
3
Perhaps avoid using the wild imports and list imported classes explicitly?
4
Perhaps naming "end" as a more descriptive name such endDate ?
5
nice description of what the if
condition will filter out with examples
6
Perhaps explain a bit more about the specific use of return
since every other cases are using break
?
7
Nice use of enums
8
Nice use of Optional
along with orElseThrow
9
Maybe put a bracket around line.get(1) == "1"
to make it easier to be understood
10
Perhaps use delete
as present tense for verb?
@georgepwhuang
(10 comments)1
Constant names must be all uppercase using underscore to separate words.
2
Deep nesting (4 levels), should avoid nesting over 3 levels.
3
Deep nesting (4 levels), should avoid nesting over 3 levels.
4
Deep nesting (4 levels), should avoid nesting over 3 levels.
5
Names representing methods must be verbs.
6
Names representing methods must be verbs.
7
Names representing methods must be verbs.
8
Write descriptive header comments for all public classes/methods.
9
Write descriptive header comments for all public classes/methods
10
Write descriptive header comments for all public classes/methods
@nickyfoo
(9 comments)1
Perhaps a less ambiguous variable name? If checked means done, then perhaps naming it isDone would be clearer
2
Maybe a plural form to represent the collection of Tasks?
Also perhaps a more intuitive name for a Task, instead of a CheckList, which might give the impression that it is a collection of objects?
3
See above for name suggestion
4
Perhaps a variable name that reflects the things contained in the list, e.g. tasks?
5
Perhaps a less misleading method name? It seems to be saying that it lists out the tasks in a string (what string?)
Maybe "tasksToString()"?
6
Perhaps a less confusing method name? e.g. showMatchingTasks?
7
Maybe write it as checkDateEquality?
Though iirc LocalDate has an equals method already
8
Interesting way of parsing which task it is! 😃
9
Perhaps a forgotten access modifier?
@Maurice2n97
(9 comments)1
Maybe can consider breaking the line to enhance readability?
2
Maybe can rename to checkIfValidCommand? So as to make the method more verb-like?
3
Maybe can refactor this so as to have less deeply nested code?
4
Maybe can consider breaking up into smaller functions to help parse the input and check if the input is valid?
5
if line is a static constant in UserInterface maybe can consider naming it LINE instead?
6
maybe can consider putting line breaks here to enhance code readability?
7
maybe could consider not using static import here?
8
Maybe can consider reordering import statements in alphabetical order?
9
maybe can consider putting the comments on a seperate line before the if block?
@ampan98
(9 comments)1
Can the scope of temp be smaller?
2
Should this be named tempTasks instead?
I noticed there are several instances of this issue.
3
Can this be moved and reframed as a Javadoc comment for this method?
4
Is there an extra space between 'temp' and 'The'?
Additionally, is there a reason to name it 'temp' instead of 'task'?
5
This seems to function like an ArrayList with an extra setDone method. Would it be better to implement TaskList as an extension of ArrayList?
6
It looks like you are initializing temp separately for todo, deadline and event so you could consider declaring it within those blocks.
7
Should there be a description here?
8
Should there be an empty line after this?
I noticed there are several instances of this issue.
9
Should there be a full stop at the end of this line?
I noticed there are several instances of this issue.
@laurenlhy
(9 comments)1
I like how descriptive the Javadoc is! Should the first sentence of your Javadoc comments be a short summary of the method?
2
Should there be a header comment for each class?
3
Should the extra empty line between description and parameters be removed?
4
I like this! Should the line breaks come before the "+" operator?
5
Should there be a space after "if"?
6
Perhaps the names "start" and "end" can be ambiguous as they can be a verb or noun, so maybe they can be renamed to be more descriptive?
7
Maybe the extra asterisk should be removed?
8
I like how the method name is descriptive!
9
Maybe there should be a "break" or Fallthrough comment after the statements in case and default?
@vvan-essa
(9 comments)1
Perhaps there should be whitespace on the left and right of the "-" sign? (:
list.get(i - 1);
2
Perhaps imported classes should be listed explicitly? (:
3
Perhaps the method names could be more descriptive? In verb form? (:
4
Perhaps more javadoc comments for the methods? (:
5
In method header comments, the first sentence should start in the form "Saves ...", "Returns...", "Adds..." and not "Save...", "Return...", "Add..." (:
6
deadlineDetails (: perhaps a small spelling error
7
Perhaps convertStringListToString? (:
8
I like how you handled the exceptions for a lot of different cases! (:
9
Perhaps convertTaskToString? (:
@YuFeng0930
(9 comments)1
Constant names must be all uppercase.
2
There should be a line break to separate functions. JavaDoc for public functions need to be added also.
3
Cannot write everything in main function. Even if it's not main function, this function itself is too long also, which reduce the readability of the code.
4
There shouldn't be a line break between JavaDoc and function header.
5
Agree with you, since the scope of arr is quite big.
6
Should JavaDoc start with an upper case letter? (Adds a task...)
7
Maybe should rename it as "addTask"? Besides, this function seems a bit too long.
8
Most of the functions in this class act as a printer. Hence, maybe these functions should be renamed as e.g. "printAddedTask"? Otherwise, it's not easy to know "addedTask" (and other functions in this class) are actually printers.
9
Constant names must be all uppercase. --> RESULT? There are also other constant names need to be change in your code.
@skinnychenpi
(9 comments)1
I really like the way how you use switch. It makes the code elegant.
2
Maybe it's better to split into 2 lines.
3
Excellent coding style and exception handling.
4
Really like the way you add comments to make the code easier to read.
5
Same question
6
Just curious whether using absolute path will influence future distribution of the program.
7
Maybe it's better to check the taskType, for example:
'if (taskType == TODO) {
.....} else if (taskType == DEADLINE) {
.....} else if (taskType == EVENT) {
.....} else {
throw new DukeException(....);
}
'
8
Perhaps it's better not to use too much else statement as there could be some other types of tasks in the future and so it's harder to maintain the code. Maybe use more else if to judge the type of tasks will be better.
9
Maybe you can consider to change Process into Processes. Just one tiny suggestion.
@RuiXiong2211
(9 comments)1
Perhaps the method name could be changed to isFileAvailable() to make is sound more like a boolean method.
2
Perhaps the method name could be changed to isDirectoryAvailable() to make is sound more like a boolean method.
3
Perhaps the class name can be changed to ToDo instead.
4
A suggestion would be to use switch statements instead of if else blocks as it would make your code look a alot neater.
5
Method name should be in camel case.
6
Perhaps you can write a comment to describe why the catch block returns nothing.
7
Maybe you can give more description on what the easter egg class does
8
An explanation on why you are creating new objects instead of altering the current object would be great!
9
instead of checkInvalidTaskNumber, perhaps you can rename is to isInvalidTaskNumber.
@kaixiangtay
(9 comments)1
Avoid using magic numbers as check conditions like arr.length != 4. If there is really a need, maybe you can use assigned the value of 4 to a variable in a way that can help increase code readability.
2
In the Parser.java, the executeCommand method consists of more than 50 lines of code. One piece of advice I will like to share with you is to try to avoid long methods and abide closely by the 30 lines of code rule for a method.
3
Distinguish clearly between single-valued and multi-valued variables. If possible, you can name the list into other more meaningful and obvious names like tasks.
4
Try to avoid misleading names such as isAlive because as a developer reading your code, it is easy to misunderstand the meaning behind the TaskList attribute, isAlive.
5
Do note that the catch statement should start on the same line as the closing braces of try block.
6
To add on what internityz has mentioned above, for the line 53 code in Storage.java, you can consider renaming the Arraylist>Task> taskList to tasks.
7
One thing I want to highlight here that can be of interest to you is according to the coding standard, each switch statement should include a default statement even if the default does not contain any code.
8
Do note that the else statement block should also start on the same line as the closing braces of the if block.
9
Just a small mistake here of having an extra line of space on line 91 in Parser.java.
@yeoutzer
(9 comments)1
I like how the imports have consistent ordering.
2
Might be better to add javadoc for this method?
3
Should this variable name be in plural?
4
Might be better to add javadoc for this class?
5
I like how the code has followed the java coding standard.
6
I like how the function names explain what the code does.
7
I like how the variable names are not misleading.
8
I like how the function name uses verbs, following the code quality guideline.
9
I like how the variable name uses standard words and no slangs.
@guanyz
(9 comments)1
From an object point of view, might it not be a bit odd to create a new Parser object for every input the user makes?
2
Consider renaming this variable to further specify what the contents of the list are?
3
Consider storing these numbers as static variables?
4
Consider storing these numbers as static variables?
5
Perhaps consider using the + operator for better readability? (As of Java 8 and onwards I believe it's converted by the compiler, so you shouldn't lose out on performance.)
6
Perhaps consider using the + operator for better readability? (As of Java 8 and onwards I believe it's converted by the compiler, so you shouldn't lose out on performance.)
7
Should this be in PascalCase (Ui)?
8
I like how clean this method is!
9
Perhaps this variable could be given a clearer name? It took me a bit to realize what it was meant to store.
@jxrrelo
(9 comments)1
Appreciate the effort to bring this statement to the next line because the line is pretty long. Makes it easier to read, keep it up!
2
Since this method is a getter used to fetch the value of isExit variable, should you consider changing this to getIsExit() or method names along those lines to avoid confusions between the class variable and class method?
3
Did you miss out a space between "Command" and "{" character?
4
As a getter used to fetch the numerical size of the task list, should you rename the method to "getTaskLength" or "getTaskSize" instead?
5
Should the class name be Deadline instead of AddDeadline? The latter sounds more like what we would usually name a method. This also applies for some of the other classes you have.
6
According to the Java coding standard for boolean variables/methods, could it be more appropriate to use isExit()?
7
Should final variables should be in all capital letters, including an underscore if there are spaces present?
8
I like how you organized this neatly because it is a long statement. Makes it really easy to read, keep it up!
9
Since this method is a getter used to fetch the value of isDone variable, should you be naming it as getIsDone() or any method name along those lines to avoid confusions between the class variable and class method?
@justgnohUG
(9 comments)1
Perhaps a more meaningful name for @param could be possibly replaced here
2
Not too sure if "Overriden" is the appropriate term here. I think "Overloaded constructor" may be more appropriate.
3
Minor typo for "list"
4
Might be a good idea to add "@Override" tag if this method is truly overriden
5
Perhaps consider standardizing on having or omitting "\n" between JavaDoc description and @param etc.
6
Second this. I believe your switch-case statements in your Parser were indented as per Java coding standards.
7
Perhaps the comment could be written as a JavaDoc instead!
8
Consider utilising other tags like @author
9
Overall, the code quality was great!, besides a couple of minute details, and I discovered different encapsulations and OOP use cases from your project. Keep up the good work!
@zenlyj
(9 comments)1
Although line does not exceed the 120 character limit, perhaps you could add line breaks to improve readability?
2
I understand that Collections also use "size()". But the coding standard specifies that methods must be verbs. Maybe you can rename it as "getSize()" instead?
3
Similar to TaskList.size(), perhaps it is more appropriate to use a verb to describe this method?
4
Should there be a spacing between the header line and the parameter description line?
5
Perhaps using isNewToken and isUnmatchedQuote would better describe your boolean variables?
6
Perhaps you could redefine your logic here to avoid deep nesting?
Edit: referring to the process() method, not only these few lines. Sorry for any confusion.
7
Perhaps you could consider simplifying the logic within this block to improve readability? Also, is there a way to avoid performing multiple type checking and type casting?
8
Setter methods should be named with prefix "set", perhaps you should name it as "setComplete()" or "setDone()"?
9
Maybe you can consider setting this variable to "private" for encapsulation? Also, there are no classes inheriting from TaskList that would require access to this variable, so it should not be protected?
Perhaps you can also rename tasklist to tasks? I think it is more natural to have TaskList having tasks rather than TaskList having tasklist.
@wongkokian
(9 comments)1
Do remember to leave a blank line between package and import.
2
For JavaDocs, your first sentence should start with "Uses" instead of "Used". Also, do remember to leave a blank line between your description and return values/parameters.
3
Do take note of the Java standard layout of import statements.
An example is as follows:
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import org.loadui.testfx.GuiTest;
import org.testfx.api.FxToolkit;
import com.google.common.io.Files;
import javafx.geometry.Bounds;
import javafx.geometry.Point2D;
import junit.framework.AssertionFailedError;
4
Shouldn't method names be verbs? A suggestion would be "readNextLine()".
5
Is this dead code? If it is, try not to leave this within your working code. If you think that you might rely on it again, make use of revision control to recover it.
6
Shouldn't this be "greet()" instead of "Greet()"?
7
Do try to follow the Java standard layout of import statements. Like static imports should be placed above, and there should be blank lines between imports from different packages.
8
Do try to avoid leaving empty catch blocks, or at least try to leave a comment explaining why it was left out.
9
Do try to give a meaningful names to class variables. As for this case, a suggestion would be to use "string" or "response" instead of "s".
@yhtMinceraft1010X
(9 comments)1
Case blocks for "deadline" and "event" look quite long. Maybe abstracting out the code segments for handling input description and datetime could help to reduce length of case block and also place the code segments under method names that can be easily found if further editing is needed?
2
I noticed a lot of command.length() checkers in if statements across many case blocks. Maybe abstracting them out into a single method could help reduce indentation levels and case block length?
3
Shouldn't the classes imported from java.io be spelt out rather than lumping them together into a wildcard?
4
Personally, I prefer moving everything inside the for loop into a single method so as to reduce indentation levels. I believe it's worth some consideration, especially if you wish to convert this for loop as well as others into Streams.
5
Shouldn't the last line of the Javadoc comment be right before the Command class, rather than have a line space in between both?
6
Perhaps an empty line between the description and parameters would fulfil the code's adherence to standards regarding Javadoc? ... I've also noticed the same trait across many Javadoc comments in most classes
7
Shouldn't there be Javadoc comments on the CommandDelete class and its public methods? ...I've also noticed a few other classes which are missing Javadoc comments.
8
I also noticed that many one-line public methods from this point on also lack Javadoc comments. I believe that there should still be Javadoc for one-line methods to explain what the method intends to achieve.
9
Perhaps this unused method should be removed?
@weixue123
(8 comments)1
Would it be clearer if a named constant or method was used to extract the task number instead? (instead of using a "magic" number)
2
I feel that the code is clear enough for certain comments to be omitted!
3
Perhaps use a method to reduce the code duplication here?
4
According to convention and for better readability, maybe consider indenting the trailing comments to the same tab setting?
5
I think there are times when it is not really necessary to have multiple blank lines in between parts of your code?
6
Perhaps the code can be more readable if the IF/ELSE statements are written in a way that is less nested?
7
I feel that the use of line breaks can be more consistent! For example, whether or not to include an empty line at the EOF, or how many of such empty lines to put, etc.
8
Maybe consider deleting dead code? So that your codebase can be simpler and easier to understand.
@totoyoyo
(8 comments)1
Maybe "date" would be a better name than "event"?
2
Perhaps this check could be made into a single method? I see it repeated a couple of times.
3
Maybe use the "inform" like you did earlier? It may be good to denote the method just returning a string and not actually adding the task.
4
There might be a few unneeded spaces here.
5
The indentations could perhaps be more uniform here.
6
Perhaps it could be nicer to read without the extra line-breaks between the cases?
7
I like the use of "at" and "by" to denote the time for the different event types!
8
I like your use of line breaks to separate code blocks and comments! But for smaller methods, maybe it might be a bit distracting?
@NiniJiaying
(8 comments)1
Perhaps there can be Javadoc comments to tell readers how this method works.
2
Perhaps it would be clearer if this method name starts with a verb?
3
Perhaps the parameter name can be something like commands? lst may sound a bit unclear to readers.
4
Maybe you can consider putting classes into packages.
5
Perhaps this variable can be named in the plural form.
6
Perhaps there could be Javadoc comments for this constructor.
7
Perhaps giving a more meaningful name can be better?
8
Perhaps it would be more comprehensive if this method name starts with a verb.
I noticed the same issue in several other places too.
@Winniehyx
(8 comments)1
Avoid complicated expressions. You can consider setting intermediate values first before calculating the final value.
2
You can consider setting parsedDate.format(DateTimeFormatter.ofPattern("E, MMM d yyyy"))>
as a variable to improve readability.
3
I think there are too many else if statements. You can try restructuring the code to make it as unindented as possible.
4
Try adding javadocs, I realized you have not done it.
5
You can add what this code returns with @return. You can do this for the other methods too.
6
I think this could be more elaborate
7
I like how you personalise your code
8
This could be renamed to taskSize() since there is already a method called size() in java.
@wangtao0717
(8 comments)1
According to code standard, I think leaving a line break between the description and parameter section will be better.
2
Perhaps a more intuitive variable name here?
3
Perhaps it may be more concise to replace if-else if method with switch method here.
4
The Duke.java seems too long, will it be better to extracte some code out as some classes or functions?
5
Perhaps it is better to break before an operator "+"
6
There is a lot of the same indentation, maybe it can be extracted into a variable, which can be changed easily later?
7
Perhaps use variable name isRelated is more sounded boolean.
8
I like your usage of enum
@Assyarul
(8 comments)1
Stating class variables as null seems redundant as removing " = null " gives the same effect. Not really a coding violation but lesser code is written as a result.
2
Perhaps it is better to have a longer method name here e.g getTask ?
3
getListToString seems more appropriate here as you are returning a String as the output.
4
The methods here should be renamed to reflect the actual use of the function. No printing is done within the method. e.g getWelcomeMessage(), getByeMessage()
5
Extra line. Might be redundant.
6
Same goes for here.
7
addTodo, addEvent and AddDeadline seems could be simplified by using inheritance, using a Base class instead.
8
Hard to recognise the use of the function from the name at first glance. Perhaps toSaveFileString()?
@OhJunMing
(8 comments)1
String des could be renamed more meaningfully as description?
2
makeDeadline() >> createDeadline()
rename method name?
3
rename st to storage?
4
try "tasks", "lists" instead of "lst" ?
5
Empty line between description and parameter section?
6
Empty line between description and parameter section?
7
Consider using switch case statement, better readability?
8
Consider using switch case statements, better readability?
@swayongshen
(8 comments)1
Could this method be separated into multiple shorter methods?
2
Would it be possible to simplify these expressions?
3
Would i be possible to shorten this method such that it is shorter than 1 page?
4
Would it better if you imported only what you needed?
5
Would it be better to use SCREAMING_SNAKE_STYLE for static variables?
6
Would it be better to use SCREAMING_SNAKE_STYLE for static variables?
7
Should there by a period at the end of the param description?
8
Would it be better for this method be compartmentalized into smaller methods that are shorter than 30 LOC?
@NBH99
(8 comments)1
Should list out all the import class instead of using wildcard.
2
Maybe a empty line between the description and @param would make the comment more similar to the coding standard for comments.
3
Maybe remove some empty lines here to make the code more concise.
4
Maybe remove some empty lines here so that there is no big empty space at the end of the code.
5
The name taskNo could imply not having task instead of task number.
6
Maybe put an empty line between the description and @param here to make the comment more similar to the coding standard for comment.
7
Maybe the term CSV in the method name could be Csv instead.
8
Maybe the boolean name could be isDone instead of done.
@TeoHoeKeat
(8 comments)1
should there be a variable name that is more intuitive at indicating that the variable is a multi-variable?
2
The coding standard suggests that the Iterator variable (t) should only be used in nested loops only,
use Nouns for Things
3
Perhaps a more intuitive variable name here?
4
Perhaps it better to put "_" between the word as suggested in coding standard for better readability. (PATH_NAME instead of PATHNAME)
5
In method header comments, the first sentence should start in the form Returns ..., Sends ..., Adds ... (not Return or Returnning etc.) : from https://se-education.org/guides/conventions/java/intermediate.html#comments.
... I noticed the same issue in several other places too
6
Maybe the JavaDocs header comment for the enum class is missing?
7
I think JavaDocs comment is missing for this class.
8
I think JavaDocs comment is missing for this class.
@Sharptail
(8 comments)1
Should there be a JavaDoc here to tell us about the functionalities of these methods?
2
Should this line be in Egyptian style?
3
I like the naming of these methods, it really shows what the methods do. However, write a JavaDoc comment might be able to provide more information about the method.
4
Should this IF-ELSE statement be in Egyptian style? I noticed the same issue in other classes as well, do note that according to the Java Coding Standard, IF-ELSE statement should follow Egyptian style even though it is only a one line code.
5
Should there be a JavaDoc Comment to tell use what does this class represent?
6
I like that you use "user" and "duke" to differentiate the respective images. However, would it be more appropriate to name them as "userImage" and "dukeImage"? As "user" and "duke" might be a more suitable name for the respective Object Class.
7
Should there be JavaDoc comment to tell use what the class represents? I noticed the same issue in several other classes too. It would be good to have a JavaDoc comments on the class so that we can know more information about this class.
8
Should the switch-case statement have the same indentation?
@Marc-97
(8 comments)1
Perhaps use a more descriptive name for "first"
2
Perhaps you could add a line break to improve readability
3
Maybe declare a constant for "\u2713" & "\u2718"
4
Maybe change the method name as it is currently printing all the items in tasks
5
Perhaps you could change the variable name from taskList to tasks. Same for the other methods
6
Perhaps you could explain the return values
7
Maybe you could add comments for both the add method
8
perhaps a more descriptive name for tokens[0]
@WeiLiangLOL
(8 comments)1
I think from first glance, it could be useful if you described in greater detail what you mean by "an object of the Command type", but overall pretty self-explanatory method names. 👍
2
I like that it throws the standard IOException for errors, it helps that it's not misleading, as @yeoutzer said!
3
Slight typo for as, but its pretty good overall! Keeps to the specified coding style!
4
Could use a space after Task, but perfect otherwise!
5
It'd be nice to leave a Javadoc header for the DialogueBox class!
6
I like that the error thrown is very self explanatory!
7
Some of the methods, though already very self descriptive, could use some javadoc comments as well.
8
Could use some javadocs!
@tanboonji
(8 comments)1
Perhaps you can use your Keyword enum here since the cases are your Keyword enum values?
2
Perhaps the code inside the two if statements can be abstracted into another method? The code is almost the same in both if statements, with the exception that one is for creation of Deadline while the other is for creation of Event.
3
This exact code which parses a String to Date object can be seen multiple times throughout your code.
Perhaps would it be better if the method is abstracted into another class (eg. DateParser
) and made into a static method?
This way, you can still access the same code from your other classes and at the same time, improve the maintainability of your code as you would only be required to edit it once if it is abstracted into a separate method and class.
4
There is a missing line break between the variable declaration and constructor. You might have missed it out by accident.
5
Perhaps you can include an empty line between the description and parameter section in the Javadoc. It will help to improve readability and will comply with the coding standard.
6
There is a small indentation error at *
. I believe you have missed it accidentally.
7
Perhaps you can include an empty line between the description and parameter section in the Javadoc. It will help to improve readability and will comply with the coding standard.
I have noticed this issue exists in all your other Javadoc too.
8
Perhaps you could use the three part format featureUnderTest_testScenario_expectedBehavior()
for test method names? The three part format provides more clarity on what is being tested in the method.
This three part format naming convention can also be applied for your other test method names.
@yuheem
(8 comments)1
Should a header comment be added here?
2
Should a header comment be here?
3
Would a more descriptive variable name be more suitable since the function parameter has a large scope?
4
Issue mentioned in other places.
5
Possibly make it more succinct by changing to toAdd?
6
Possibly use a local variable name for the number of tasks in the task list?
7
Same comment as prior about local variable name.
8
Would matchedTasks seem better?
@pPris
(8 comments)1
I liked this idea of having an UnknownCommand class
2
I like how it's easy to understand the purpose of this test from the method name, noticed it in other instances too.
3
I like how it's obvious how your UI formats messages from this method body.
4
Perhaps there could be a header comment for this class, if it's meant to be your main class? (If I assume right, this seems to be your entry point for your programme?)
5
I like how neat this if else block is. There seem to be some hardcoded strings passed into the split function - perhaps they could be assigned to some variables with descriptive names, or other comments could be added to explain more about what's happening in this function?
6
Could this variable be named to sound more 'boolean'? (I did like that you've followed boolean naming conventions in other places)
7
Agreed with this reviewer, it's easy to understand what errors are being expected especially with your javadoc comment too
8
Perhaps there could be a brief comment on what a fresh task means here?
@Jellybeano
(8 comments)1
Does the 1 here look a bit like a magic number? Perhaps can consider explaining it in the comment
2
Could the DateTimeFormat perhaps be saved as a final String to avoid repetition?
3
Interesting classes!
4
A final int TASK_DONE = 1 could be optionally used here
5
Should here be a empty line here?
6
Not sure if required but the JavaDoc comments all appear to end with fullstops
7
In method header comments, the first sentence should start in the form Returns ..., Sends ..., Adds ... (not Return or Returnning etc.)
-from the styling guide, perhaps can consider saying "processes the task...."
8
Nice emoji!
@NightRaven49
(8 comments)1
Should these have punctuations?
Possible to review the other Javadocs in the rest of your code too.
2
Should taskList be tasks instead?
3
Perhaps you can consider naming the Scanner object as a noun rather than a verb.
4
Do consider using plural forms for collections.
5
Agreed with IceBear. Would also make program easier to edit rather than having to Crtl-F the class every time.
Also, can consider explicitly listing which packages are being imported rather than using wildcards.
6
Not sure if this filepath will work on non Windows machines.
7
Should there be a line break between description and parameters section? Can also look at other Javadocs.
8
Should the name of the collection be in plural form instead?
@ZhangAnli
(8 comments)1
Should you use a wildcard import (*) here? Would it be better if you listed out the needed packages only?
2
May I ask for the purpose of the spaces in front of your output string? Is this for aesthetic purposes? I have noticed this in a few other places as well.
3
I think it would be good to add a spacing right above the try block to separate the code logic between the two blocks.
4
Can I ask if the spacings in front of your string output was intended? This seems to be done on purpose and I have seen it quite often. Is it for UI purposes?
5
I believe checkstyle prefers if there is an additional empty line after the last parentheses in your files. You may want to check up on that.
6
Do you think it would help if you left spaces between consecutive methods? Have noticed this in a few places and because of the javadoc comments, it may make your code seem a bit "cramped".
7
Perhaps a more intuitive name for the localdate variable will be better? I feel that just stating "by" could be hard to read for some.
8
Would like to clarify the purpose of this file since it is essentially an empty file?
@samleewy
(8 comments)1
Might be better to use tasks
as variable name, might confuse yourself with the TaskList
class.
2
Perhaps following the featureUnderTest_testScenario_expectedBehavior()
test method convention will be better.
3
Same as above, featureUnderTest_testScenario_expectedBehavior()
convention.
4
Same as above, featureUnderTest_testScenario_expectedBehavior()
convention.
5
I agree with @figo2127's comment! Might confuse yourself with the Deadline
model name.
6
Nothing critical, whitespace after DukeException required 👍
7
Same as above, whitespace after DukeException
8
test method does not follow the featureUnderTest_testScenario_expectedBehavior()
naming convention
@ZechariahTan
(8 comments)1
Should there be some documentation for this method? I noticed there aren't any javadocs for other methods in the code as well
2
I think a //Fallthrough comment is needed here in case DEADLINE and EVENT according to the coding standard? Similar issue was spotted in Parser and UI.
3
Maybe a default case should be added here? I'm not 100% sure but the coding standard provided states that a switch case should have a certain form and it included a default case.
4
I like that this ternary was broken into two lines to keep within the 120 char limit but should it be formatted as
(CONDITION)
? method1()
: method2()
instead?
5
Could this expression be expanded? It looks a little difficult to decipher. (Textbook section)
6
Could these blocks be simplified / abstracted out? (Textbook section)
7
I like that all your method names are verbs where applicable
8
Would a switch case here make the code more readable? I don't think its in the coding standard so it might just be a personal opinion but the block of code here looks like it fits exactly what a switch case would do.
@yungweezy
(8 comments)1
Perhaps a better way to name it would be "textInput"? Since there is a "cmd" or Command type that could be misleading.
2
I believe it would be better to name your variable fully ("tempString" instead of "tempStr") to improve readability!
3
Seeing that there are multiple if else cases, perhaps you may want to consider using a switch case? That would improve future developers to be able to figure out components easily by looking at the case conditions! 😃
4
Perhaps you may want to separate the classes into different Java files? That would certainly declutter the amount of code in single Java file and makes it easier for developers to look at a specific area of code. Doing this would cause future extensions to increase the number of lines in a single class even more.
5
Perhaps you may want to change this to Egyptian style braces (CS2103T coding style)?
6
Maybe you want to change the boolean variable name to sound like a boolean instead? How about "isTaskDone", how does that sound? 😄
7
Haha, I get the joke! But maybe it would be better to name it to a more readible and intuitive variable name, like "taskList". In case some developers do not appreciate the humor. 😝
8
I like your use of switch case statements! However, do note that we may need to add the "//Fallthrough" under each case where a break is supposed to be placed, but unreachable!
@SiTingST
(8 comments)1
Perhaps might want to add more spaces in front to indent this method to fit with the Java coding convention.
2
It might be a better idea to import relevant files from the task folder instead of importing all?
3
I like how you remember to add spaces around i + 1;
4
"The explicit //Fallthrough comment should be included whenever there is a case statement without a break statement.", quoted from Java coding convection.
5
Perhaps you can change parserTest2/3/4 method name to something more meaningful?
6
Would be better to avoid using misleading names?
7
Perhaps can change it to showAddedMessage?
8
Might be a good idea to rename t ?
@Hzxin
(8 comments)1
The variable name "by" is not clear and may lead to confusion sometimes.
2
Maybe naming it as isSaved or isSavedBefore make it sound more boolean?
3
I agree with Tomashiwa on this, pass the taskList into Parser from your TaskList class will make it simpler.
4
Variable naming should be more detailed to reduce confusion
5
Maybe using constructMessage sounds better and more fluent than using constructMsg?
6
This method doesn't serve to construct TaskList in my opinion, perhaps naming it as displayTaskList would sound more reasonable. What do you think
7
Maybe naming the variable in full will be clearer
8
This looks abit too nested and maybe have another helper function to reduce the blocks?
@nicoleang09
(8 comments)1
Maybe instead of using the else block to handle the case of an Event task, it can be used to handle invalid task types?
2
Should the block to handle to do tasks be stated explicitly in an else-if block instead?
3
Same comment as before.
4
Perhaps format this sentence such that it starts with "Returns..."?
5
Should there be a short summary of the method here?
6
Should case blocks have the same indentation as the switch statement?
7
Should case blocks have the same indentation as the switch statement?
8
Should plural form be used to represent a collection of objects for ArrayList>Task>?
@maxxng
(8 comments)1
Should there be an empty line between the description and parameters?
2
Should you try to avoid using wildcards when importing
3
Should you have an ordering of your import statements?
4
Should your boolean variable name be isDone?
5
Should your variable name curr be currentTask?
6
Should there be a punctuation at the end?
7
Should the parameters require some description?
8
Should there be some comments in this line for the return value?
@pavz02
(8 comments)1
Perhaps you could try to decrease the number of nested blocks.
2
I believe that savedata does not follow the coding standards, and it should be saveData instead.
3
I think there is a slight inconsistency with the coding standards in errorMsg and that the '+' should be in the second line in front of the "Please don't manually edit the save file.";
4
Similar to my above comment, I think you could try to reduce the amounts of nesting in the method parseTask.
5
Perhaps the instead of 'parts' the array name could be more descriptive.
6
This method could have been called getTask instead for more clarity.
7
Similar comments for this delete method and the add method below. I think deleteTask and addTask could be better method names.
8
Perhaps switch-case could be used instead of if-else statements.
@yutingzou
(7 comments)1
Do you think 'private' would be a better modifier for variable 'by'?
2
Would it be better to name the boolean variable as "isDone" and the char variable as "status" instead?
3
Do you thinking creating a utility function to re-format String 'save' at one go will be helpful? It may make the method shorter and more concise:)
4
Would creating a String variable to store tasks.storage.get(i).getDescription() before the 'if' statement be better?
You may also consider creating:
Task task = tasks.storage.get(i)
String description = task.getDescription()
😃
5
Would getCommand or extractCommand be a better naming?
I've also noticed the same issue in other methods. For example, the 'description', 'date' methods. It might be a bit confusing without a verb in the method name 😃
6
Since it's an add command, do you think addTodo, addDeadline and addEvent are more informative naming?
I've also noticed the same issue for other Command child classes:) but I like the way you standardised similar method names across all child classes.
7
Will getSize() be better?
@Prabhakaran-Gokul
(7 comments)1
Perhaps it is better to name this method as isOnDay?
2
Perhaps you can consider choosing a more descriptive name for your parameters?
3
Maybe the starting letter can be capitalised?
4
Consider adding an empty line between the description and the parameter section? I noticed this minor issue in other areas of the code as well
5
Perhaps it would be good to add comments to some of your code logic such as tokens.length >5
6
Perhaps the extra spacing before "Input string." can be removed?
7
I like that you have a method to deal with string formatting. Maybe the method name should be joinStringWithNewLines instead? (ie Lines instead of line)
@DineshMagesvaran
(7 comments)1
Maybe a short summary of the method could be written as the first sentence for this method header.
2
Plural form could be used for this String array to make the variable name sound more like a collection of string values.
3
Would it be better if javadoc comments were included as there is more than one constructor?
4
Is there a more descriptive variable name that could be better for 'at'?
5
It is recommended for the method header to start with 'passes' instead of 'passed'.
6
'isFound' may be a better alternative to 'found' as it is a boolean variable.
7
Well written error message as it is very descriptive and tells the user what to do.
@garyljj
(7 comments)1
Don't forget to private attributes for encapsulation 👍
2
Perhaps use singular form (ToDo) since plural form usually represents a collection of objects, eg. List
3
Very minor but remember to leave white space before "{" just for consistency and readability 😄
4
Perhaps could abstract the file type "T" out as a constant variable? same for other file types too!
5
Encouraged to use verbs for method names! Maybe example getFileString()?
6
Boolean name should sound like booleans. eg isDone
7
Remember to leave "Empty line between description and parameter section"!
@onnwards
(7 comments)1
Should there be an empty line between description and parameter section for javadocs? I noticed this for your other javadocs as well.
2
storage
and ui
be in uppercase?Honestly, I wouldn't consider this to be violations, but I'll leave it to you to judge:
- Your variables are final whenever possible, which is good,
- However, that means it probably should be written in uppercase according to the coding convention.
- My personal belief is that only static final variables should be written in uppercase, but the coding convention isn't clear on that.
- However, an example they provided was `final int COLOR_RED = 1;` which leans towards the former,
3
storage
and ui
be in uppercase? I noticed this in other areas as well.Honestly, I wouldn't consider this to be violations, but I'll leave it to you to judge:
Your variables are final whenever possible, which is good,
However, that means it probably should be written in uppercase according to the coding convention.
My personal belief is that only static final variables should be written in uppercase, but the coding convention isn't clear on that.
However, an example they provided was final int COLOR_RED = 1;
which leans towards the former,
4
should pathname be pathName instead?
5
should taskList be written with a plural word instead? ie. tasks
6
not a coding standard violation, but List.remove()
returns a Task
, so you can actually do Task deletedTask = tasks.remove(index) instead 😃
7
This is the first time i'm seeing this syntax. How does this work?
@kingsleykuan
(7 comments)1
Should a wildcard import be used here? Perhaps you can consider importing the specific class if possible!
2
Here instead of breaking after the operator you could break before it. For example, instead of:
"...." +
"...."
you can do:
"...."
+ "...."
3
Should the else if
statement be on a different line than the curly bracket? Since you have used the Egyptian style braces for most of the project it might be a good idea to update these parts to make it consistent
4
Should be a quick fix but I noticed that the indentation here is off by 1 space!
5
I like the use of comments for these public methods, perhaps you can take it a step further and make them javadocs comments instead.
6
I like the small detail of adjusting the grammar based on how many tasks there are! At the same time, this ternary makes the expression slightly hard to read. Perhaps you could consider moving it out of the println.
7
Great error checking here, but instead of nesting the if statements, perhaps they could be combined into one?
@SoulUseless
(7 comments)1
Since this class indicates a singular Deadline Task object, it could be better if you named your class in the singular form instead of the plural form. This also reduces confusion should the need for having a Deadline array arise.
2
I have noticed that you have implemented DukeException.java as a error handling class. Perhaps you can leverage that to handle your exceptions instead of printing them here?
3
I like how thorough your error handling is. However, the main function is very long. Would it be better to abstract some if-block code into separate functions to aid readability?
4
Since this is a function that does an action, would it be better to name it in a way that it sounds like a function?
5
I like your use of the inherited toString() method.
6
Since this function is an action, would it be better to name this is a way that sounds like an action? (Eg: markAsDone())?
7
Since this is a function that does an action, would it be better to name the function as a action? (Eg: printAddedTaskReply) This would also apply to the below Reply functions as well.
@benedictkhoomw
(7 comments)1
Consider not using this
unless the member variable is shadowed by a parameter. I think this coding standard is not stated in the Basic + Intermediate Rules page but only in the All Rules page of our Java style guide.
2
Consider ending your parameter descriptors with punctuation as specified in the coding standard.
3
Not sure I like the length of this method. Maybe abstraction could be applied here. For instance, the general format seems to be
if command matches some format, then parse the parameters, then execute the command, then return feedback
I feel that there are four responsibilities here:
matching the command
parsing the arguments
executing the command
building the feedback message
Perhaps each responsibility could be given to a different class or method.
4
Consider standardizing import orders (e.g. java/javafx packages first then duke packages) in this and some other files. I like the nicely separated imports in Duke.java.
5
Is the this
qualifier necessary here? I noticed this in several other files as well.
6
Consider formatting this method using Egyptian style braces even though it has an empty body. I noticed this in another file as well.
7
Consider ending the param comment with a fullstop for consistency.
@chanellNg
(7 comments)1
Maybe there should be an empty line between the method description and parameter section
2
Perhaps could add punctuation behind each parameter description
3
maybe can stick with } else { indentation, comment can be moved up
4
Perhaps an empty line between description and parameter section could be added.
5
Maybe could add punctuations to the Javadoc comments
6
Perhaps a line break could be added here.
7
Perhaps could remove the line break for the try-catch statement.
@car155
(7 comments)1
The parseInput method here is a bit long. Maybe its better to separate some of the parts like the deadline case into its own handleDeadline method for readability?
2
Maybe use a verb for the method here? Something like sayBye()
3
Good indenting! I think it can be more readable with the plus in the front of each new line instead of at the back of the previous one.
String output = "++++++++++++++++++++++++++++++++++++\n"
+ "Here are the tasks in your list: \n"
+ "TaskType | isDone | taskName | time (if any)\n";
4
Maybe use isCompleted instead of completed?
5
Good formatting for switch cases!
6
Names of methods should start with a verb. So maybe here it can be checkIfNumeric?
7
Collections usually use plural form. So maybe tasks can replace taskList here.
@ming-00
(7 comments)1
You should check the switch identation
2
Avoid leaving spaces!
3
You should avoid overly long methods that take up more than the space in a computer screen
4
Indentation for wrapped lines should be 8 spaces (i.e. twice the normal indentation of 4 spaces) more than the parent line
5
Boolean variables/methods should be named to sound like booleans
6
Boolean variables/methods should be named to sound like booleans
7
Indentation for wrapped lines should be 8 spaces (i.e. twice the normal indentation of 4 spaces) more than the parent line
@fairyinabottle4
(7 comments)1
The case statement should be at the same indentation level as switch statement
2
The indentation is a bit too excessive here, should only be 8 spaces from the line above
3
I think you can select a better variable name than t, as the scope here is for the whole method.
4
I think it is confusing to have the variable name the same as the method that is called. I suggest that you change the variable name(see above comment)
5
While isExit is a valid variable name, I think you can choose a better one like shouldExit or canExit. From an English readability point of view, it will help things slightly.
6
I like that you managed to encapsulate all your commands under a single Command class
7
There should be a space between the ) and the {
@enhao25
(7 comments)1
Hi, in terms of code quality, perhaps we can consider to use words that are more descriptive for these variables instead of arr and arr2.
2
Hi, similarly to the previous commit, perhaps the variable name for this could be something like "fileOutput" instead for better readablility.
3
Hi, according to the "Explain WHAT and WHY, not HOW" section on coding quality. They mention that comments explaining how the code works should be avoided. Maybe it will be better to remove this comment entirely as I believe the would understand the intent of the code nicely.
4
Hi, I notice that all of the constants that has been declared final is written in the camelCase format. Not sure if it should be written in uppercase using underscore to separate words, since the it is declared final and hence, a constant. I noticed the same issue in several place as well.
5
Hi, I am thinking that boolean methods might be more appropriate to choose a name such as canContinue to conform better to the coding standards.
6
Hi, breaking up this line could make your program more readable. According to the coding standards, it will be best to have line length >=120 (Hard Limit) and >110 (Soft Limit). The character for this line is around 118 so it might be better to break this line up instead.
7
Perhaps this could be commandDetail instead as it might not need to be represented in its plural form as it is not a list or array of objects.
@lue97
(7 comments)1
Perhaps you could add a space between )
and {
?
2
Perhaps you should add a comment explaining what this class is/does?
3
You may want to consider changing your test names to something more related to what is being tested. For instance
sortList_emptyList_exceptionThrown
or getMember_memberNotFount_nullReturned
4
perhaps you could just shorten this conditional to
obj == this || obj instanceof ExitCommand
?
5
Consider splitting the imports
6
Perhaps you could add a comment on what this class is/does?
7
Perhaps expand the wildcard import instead?
@riyadh-h
(7 comments)1
A minor detail, but shouldn't there be an empty line between the method's description and parameters in the JavaDoc comment?
I noticed this in other parts of the code as well.
2
Shouldn't it be Launches
instead of Launch
?
3
Shouldn't this JavaDoc comment be updated?
4
I like how you have created an abstract Command
class 👍.
5
Wouldn't it be more concise for the method name if it was addTask
instead?
6
Shouldn't this JavaDoc comment include a description?
7
Shouldn't the names of the test methods be more descriptive? (e.g., by using the three part format)
@prerthan99
(7 comments)1
consider enumerations instead of case and switch as I believe enumerations are not case sensitive
2
It would be a good idea to explain what the param id for i.e. explain what listener is for and what it does
3
the input names are obvious so good job there, but the explanation doesnt really add anything to the javadocs
4
I usually comment in the beginning what functions each import does
5
I read somewhere that its better to name these getter methods getterIsDone
6
instead of while(true) I believe we can also do for(;😉
7
perhaps make a variable for commands[0] = firstCommand for ease of reading
@vivegank
(7 comments)1
Perhaps since this is a getter, the method name could be getTaskSize() instead?
2
Maybe you could consider avoiding long methods as the textbook says to be wary of methods that go beyond 30 LOC? This could improve the readability of the code.
3
Perhaps renaming list as tasks would help to show the content of the list?
4
Appreciate the use of named constants to improve readability of code!
5
Maybe consider putting this in Ui class for consistency since you have already put everything related to printing in that class?
6
Maybe renaming the ArrayList as tasks would be more clear in showing the content of the list?
7
Appreciate how you bring long statements such as these to the next line! Makes it easier to read.
@sjq-sohjunqi
(7 comments)1
A clear and concise name for the method! Perhaps you could include a JavaDoc header for this method as well?
2
Good line breaking to improve readability
3
Constructor is well-defined in the header but the space in between the header and method can be removed to help improve readability
4
According to coding conventions, would it be better to write out the full definition of the method here?
5
The space here could be removed to help improve readability.
6
Would you consider removing "Msg" from the name to make it shorter?
7
Good use of abstract methods here!
@LimJunxue
(7 comments)1
A more meaningful naming suggestion: String input, Pattern pattern, Matcher matcher. I found this issue in the Storage class as well.
2
Can this method name be loadTasksFromStorage to explain the method more intuitively?
3
Should this method be private instead, because it is independent of the whole program and is only used by the load method from the same class as an encapsulation?
4
Would it be better to name this method as formatDateString to reduce confusion?
5
There should be an empty line between the description and the parameters here. I noticed the same issue in most of the other classes as well. Perhaps consider configuring your IDE to help with this styling?
6
Thoughtful addition of the redirecting links to Task in this bit of JavaDocs!
7
Java coding standards states that imported classes should always be listed explicitly, although I can see why you would import * for this package duke.command. Should the different command classes be encapsulated such that BYE, DELETE and DONE can result in calling of a single factory method?
@tashawan23
(7 comments)1
Maybe it would be better if you avoid deep nesting to improve code quality
2
Maybe it would be better to leave out the indentation for case clauses
3
Would it be better to have this line format as a constant since it is repeated several times in the class?
4
I like your indentations in this class!
5
Would it be better to change parameter boolean done to isDone?
6
Maybe it would be better to change the method name to getSize() since it is a getter
7
Maybe it will be better to change doneTask to a verb such as checkTask
@JulietTeoh
(7 comments)1
I like how your command classes are named clearly
2
Is it better to name this indexOfSlash?
3
Is it better to name this dateBy or dueDate?
4
I like it that you have added clear javadocs for public methods!
5
Hi, I agree with TanJin and I think that parsedInput makes sense because the program is handling one line of user input as once.
6
Would it be better to name this expectedMsg?
7
Would this method name be confusing for some readers?
@natosy
(7 comments)1
Missing description of return String?
2
Not sure if it's just me, but I feel that this method looks very cluttered. Also, missing return definition? Not sure if it's intentional (or if it's allowed).
3
The name "at" doesn't seem very comprehensive and I wouldn't be able to tell what it is used for unless I know what an Event object is meant for and how to create one from the CLI. There is some discrepancy comparing this with your Deadline "by" property as it is of type LocalDateTime in Deadline whereas it's just a String here.
4
Similar to the Event class, I don't think that the name "by" is very comprehensive unless I know how to create a Deadline object in the CLI.
5
I'm not sure if this constructor serves a purpose as you'd be able to create a Storage object just fine without this. Unless you're setting it up for future modifications.
6
For all of your JavaDocs,
There should be punctuations at the end of every sentence in your description and every parameter definition. (Note that the descriptions are not supposed to be too long unless it is completely necessary)
There should be an empty line separating the description and parameter fields.
All sentences should have proper capitalisation.
JavaDocs of a method should be directly above a method, without a line separating them.
Below is a screenshot from the Java Coding Standard page in the "comments" section for your reference.
7
"print" should be used instead of "printing".
@tlylt
(7 comments)1
Good job on naming the interface correctly in PascalCase. I like your use of an interface here.
2
Hi, just a small inconsistency that I spotted. For some of your classes, there is an empty line between the class declaration and the class properties. However, some of the classes don't.
Perhaps it will be more consistent if all classes have an empty line in between or none of them have an empty line in between?
3
Perhaps a more descriptive name for the boolean variable (instead of "flag") will be better?
4
Hi, I suppose you could have done without super(message);
and it will still work as intended?
Let me know if there is actually an intended effect of your super(message);
😃
5
Perhaps the use of String.format()
could have been better in terms of understandability?
6
Perhaps extracting these magic numbers out as named constants will be easier to understand?
7
Overall, the process
method seems to be longer than desired. Quoting our textbook:
Be wary when a method is longer than the computer screen, and take corrective action when it goes beyond 30 LOC (lines of code). The bigger the haystack, the harder it is to find a needle.
Perhaps extract out some smaller methods?
@ong6
(7 comments)1
Imported classes should always be listed explicitly. I noticed the same issue in serval other places too.
2
Is there a better way to do this instead of using instanceof? Maybe implement a checking system.
3
Imported classes should always be listed explicitly.
4
To be honest im not too sure, but I think we were taught in 2030 that the use of instanceof breaks the open/close principle in some way you may refer to this StackOverflow page: https://stackoverflow.com/questions/20589590/why-not-use-instanceof-operator-in-oop-design
5
Please refer to the CS2103T coding conventions. Switch and case should be in the same indentation.
6
Consider packaging them under duke.task instead.
7
Consider using underscores in your test methods (refer to coding standards).
@rajobasu
(7 comments)1
Hi, I think for this the case: statements should be aligned with the switch statement instead of a 4 spaces indentation.
2
Here also should align the switch statements!
3
Usually I think it’s better to use method names that are verbs rather!
4
Just a small typo I guess, getDateError()?
5
Again I guess should be listTask()?
6
This should also be userInput()
7
This should also be findTask
@aaronsms
(6 comments)1
Whitespace before {
2
Whitespace before {. There are similar cases in other files as well, I will not point out all of them.
3
Using the '.*' form of import should be avoided.
4
Whitespace before operator '+'. Note there are whitespace issues for other keywords like 'for' in other files as well.
5
Missing javadoc for class Storage and TaskList.
6
Careful about the import statements ordering. Similar issues in other files, for example TaskList.java
@colintkn
(6 comments)1
Should the "bye" be converted to a static string BYE?
2
Could this be converted to a switch for readability?
3
Is it textWarper or textWrapper?
4
I like how you used a hashmap. Very clean. 👍
5
Should this be in caps?
e.g. private static final String LOGO = ...
6
Should these be made into a static variable e.g. BYE_COMMAND = "bye"?
@glennljs
(6 comments)1
I think you could change the name of this variable to make it more descriptive! Maybe something like "dueDate".
2
Since this is a constant variable, it should be named in caps!
3
Same as before, maybe could use a more descriptive variable name such as eventDateTime!
4
Same as before on constant names. Also I didn't mention previously but maybe could private the message since theres no need for any client to use this message outside of the class.
5
Small indentation issue!
6
Small indentation issue!
@jared98lyj
(6 comments)1
Spacing
2
Spacing
3
Shift the lines to make it top down (42 to 41)?
4
No wildcard imports
5
Can store the Task type as an attribute so you dun hard code, e.g., taskType = "T"
6
Try catch block?
@Donavanty
(6 comments)1
Should a JavaDoc comment should be added for isNumber too?
2
Good choice of String thrown, really helpful for the user in an actual chatbot context 👍
3
This is a great touch, I didn't think of catching this exception so as to print a line informing users about the date format.
4
Agreed 👍
5
I believe the toString() method, even though overridden, needs a JavaDoc description still.
(Likewise for the other classes too)
6
I believe a line should be spaced between the description and the @param for all JavaDoc commentary (even though it is not explicitly stated in this mod's check requirements). The JavaFX files practice this too.
@whatthelump
(6 comments)1
Minor issue, but you could add a period at the end of each parameter description.
2
Minor issue, but you could omit 'A method that' in the method summary.
3
Trivial but there is no need for a blank line between javadoc comments and the corresponding method.
4
Perhaps you could consider using switch-case here given there are a large number of cases (>5)?
5
I think this is trivial but perhaps you could initialize the variable tasks under class TaskList to new ArrayList()? Then you might be able to do away with the empty constructor.
6
For enum name PrintText, perhaps you could change it to something like ‘PrintedText’ to make it sound more like a noun?
@Jonathan-Cao
(6 comments)1
Minor nitpick but perhaps consider starting Javadoc sentences with an uppercase letter and ending with a full stop to keep within the coding standard.
2
Perhaps int taskToDelete could be indexOfTaskToDelete even though it may be quite long.
It may help to distinguish it from Task toRemove.
3
Perhaps you could include Parser as an instance variable for the Duke class?
4
The same change mentioned above can be applied here as well.
5
It may be possible to use String userInput as an argument for this function instead of an instance variable for the Parser class.
That way one Parser object can parse multiple user inputs.
6
I am inclined to agree with guanyz here. If possible, hope you would consider some of the possible modifications stated here.
@w-yuchen
(6 comments)1
Would AL be a bit confusing here? Perhaps tasks
or taskList
would be better?
2
Since return also breaks out of the switch block and there are no fallthroughs here, would it be better if the // Fallthrough
comments are removed?
3
I agree with vevek, arrayList or taskList could be better.
4
You may have missed out the Javadoc comments for getDescription()
here.
5
No Javadoc for findMessage()
.
6
Public constructor here with no Javadoc.
@zatkiller
(6 comments)1
Should we avoid using wildcard import?
2
Should we remove the blank lines here?
3
Should we remove these comments since it's not used as an attribute of the class or for documentation purposes?
4
Is the switch statement case indentation supposed be as such?
5
Should Delete method begin with small capital letter?
6
should Remark begin with a small capital letter as well?
@BigDoot
(6 comments)1
Following the coding guidelines, method names should be verbs. Perhaps handleError() would be a better method name?
2
Since this method is a setter, maybe setStatusTrue() would be better? It would explain to readers what status you are changing to as well!
3
Perhaps adding class level Javadoc comments would aid readers in understanding the function of each class better!
4
Maybe you could specify why/when the exception would be thrown?
5
Should old commented-out code be removed to make the code cleaner?
6
Minor typo here!
@Shuyang0
(6 comments)1
Agreed! I noticed this in Storage, TaskList, Ui and Command classes too.
2
I like how you broke up this line to improve readability!
3
Perhaps renaming by
to dueDate
would be more descriptive? Same for the Event
class.
4
I like the use of switch statements, makes it easier to read than a bunch of if-else blocks!
5
I like how you break up long lines like this to improve readability!
6
Maybe you can leave a line between import statements from different packages?
@nowknowing
(6 comments)1
Could consider making this private.
2
I think it's supposed to be data/duke.txt
You can make the getParentFile first, then the actual file to do this. (or take a look at my Storage class)
And I think you should refrain from hardcoding "duke.txt" multiple times. 1 time should do.
3
Sorry to nit-pick. The noun greeting may be better.
4
I think these can be private, as with your other classes extending Task.
5
I think this is one way. But there are also ways to assert for exceptions. Alternatively you can simply
public void todoTest() throws DukeException()
I think
6
If I'm not wrong, I think we're supposed to edit our environment variables and not paste the full path here.
I remember seeing an forum issue, made by fairyinabottle, that helped me solve it.
@CharlesLee01
(6 comments)1
I don't need a constructor for Parser especially when it does nothing.
2
I think you can remove the lines before each else if statements.
Example:
if() {
return;
} else {
return;
}
3
Instead of commenting out the codes that is not required, removing them will be better.
4
I like the way you use appropriate naming for strings.
5
I think you probably can name it as tasksFromFile.
6
Good Job! Clear explanation of the symbol use for different tasks.
@QY-H00
(6 comments)1
Should this import sentence be put above importing our own class?
2
Same as above.
3
Same advice as above for coding standard regarding to import.
4
Should we use explicit import instead of wild card import?
5
Is it better if we leave a line between different importing group?
6
Maybe is it better to add JavaDoc here to help decribe Searchable?
@zhengruoxin
(5 comments)1
Perhaps you can change "existing" to "exists" to make it sound more boolean!
2
I think you can change the name of "at" to make it more descriptive! Maybe something like "eventDate".
3
I think you can change this method name to a verb, maybe something like "incrementTaskCount".
4
Same as before, maybe something like "reduceTaskCount".
5
You may have missed out a space before the variable name here.
@JQchong
(5 comments)1
Shouldn't this variable be capitalized as it is a constant? Similar problem found below.
2
Not sure if the verb form here is not appropriate, similar problems encountered with other comments
3
Shouldn't this be phrased like other methods where you start with a verb? Probably something on the lines of 'Constructs...'
4
Good usage of @Override which explicitly labels methods that overrides parent classes.
5
Shouldn't the header comments be included as this is a public method? Similar problems encountered for other methods in this class.
@pngsebastian
(5 comments)1
Hi Wei Xue! You can try to delete the output lines before committing, just in case it affects with testing.
2
Perhaps you can list out the exceptions that you will be using in this file.
3
According to the modules' coding standards, case and default should be at the same indentation as the switch statement.
4
Hi Douglas! You might want to edit the javadocs for this since it only returns false.
5
Since it's not a DBotException, you can remove "throws DBotException".
@mrweikiat
(5 comments)1
Perharps you can use a better naming for this variable?
2
Perharps you can introduce this line into the UI class?
3
Perharps you can use a clearer and more intuitive variable name here! Other than that your coding standards looks good!
4
Careful of the spacing over here! Depending on how your code runs, the spaces might affect the print of output!
5
For debugging I see!
@banchiang
(5 comments)1
Similiar mistake as me! We can change the variable name 'by' to be more intuitive
2
String array name can be more descriptive 😄
3
Since there are many if else statements, I think using switch would make the code look cleaner 😃
4
As per coding standard, boolean variable name would be a name to point out that the variable is boolean. E.g ("isDone") would be good 😄
5
I think the @author tag can be placed at the top of the class along with the Javadoc to provide more consistency in the JavaDoc format! Other than that, your codes' naming and format is really clean and I enjoyed reading it!
@lrj689
(5 comments)1
The result of createNewFile() is unused, maybe try to put it with another if else statement
2
Maybe just isBye() is enough
3
Consider using a clearer name, ie deadline, date
4
Consider trying out switch case statements
5
Consider using a clearer name
@khiaxeng
(5 comments)1
Should there be a whitespace between Java reserved words and curly brackets?
2
Maybe have consistent line breaks within the body of a method? (Compare this with lines 52~55)
3
Maybe have consistent line breaks within the body of a method? (Compare this with lines 28~31)
4
Are curly braces required after case statement? I understand if it's a personal preference.
5
Smart way to determine whether 'task' should be plural or not
@JerardSoh
(5 comments)1
Maybe more methods could be added here to reduce the nested if brackets?
2
Could remove one blank line here
3
I think there should be an empty line before this statement
4
Maybe this boolean variable could be isDone to improve clarity?
5
I think maybe there should be an empty line before this statement?
@figo2127
(5 comments)1
Perhaps splitting the separator string into 2 lines using a "+" would be neater according to coding style guidelines?
2
Perhaps it'd be more suitable if this String is named something eg. description instead of deadLine?
String deadLine;
String description;
3
I like how your localDate and localTime are in one line. Clean 😃
4
Perhaps you can shorten the line to make your code more readable according to coding guidelines?
5
LOL!
@shaelynl
(5 comments)1
Maybe you could consider naming the boolean to isDone such that it is more understandable?
2
Perhaps you can consider using switch cases to minimize the need for if-else statements as it would improve the readability of your code?
3
This function is named "finishATask" while another one is "addTask", maybe you could pick either way to name the function and standardize it across your functions so as to keep it more consistent (i.e. either name it (verb)ATask or (verb)Task)?
4
Haha cute name, but maybe you could consider changing it to something more understandable like taskList?
5
I think under the Java coding standards the convention for a for loop is for (initialization; condition; update) (although I also use enhanced loops), you could consider changing it?
@VisnuRavi
(5 comments)1
Although this does follow the naming to sound like a boolean, but just a minor issue that isExit as phrase does not seem right to me
2
I do agree with yutingzou on this
3
Could perhaps use a actual word to name the variable spl, as it is being used throughout the parse code
4
also for the checkSplLength below
5
I believe the starting letter should be lower caps according to coding standard
@yienyoong
(5 comments)1
Perhaps this should be 'SERIAL_VERSION_UID' as it is a constant?
2
Maybe boolean could be named isCompleted instead to sound more like a boolean?
3
I like that you followed the switch coding format! I sometimes forget to do this.
4
Perhaps this variable could be named 'dateBy' or 'dueDate' for more clarity?
5
Hmm, switch case does not seem to follow the coding standard. The 'case' should be indented at the same level as 'switch'! 😃
@mabel-kang
(5 comments)1
Perhaps the name of this LocalDate variable could also be replaced by a clearer one?
2
Should there be an empty line between the description and parameter section?
3
Maybe the else statement on line 41 should be added to line 40 instead?
4
I like how you separated the string constants into a class of its own!
5
Perhaps there should be an empty line between the description and parameter section? I have noticed the same issue in several other places too
@Andrewzhang217
(5 comments)1
Well done, naming is good and coding standard is strictly followed!
2
Should you use Pascalcase to name the enum? ie TaskState
3
Generally the code is very clean, good job!
4
Should you use Camel case to name this method?
5
Should you delete the space between two import statements?
@XindiTian
(5 comments)1
perhaps there should be spacings between the variables and the value?
like distributionBase = GRADLE_USER_HOME and the sorts?
2
Does this main function do anything? If not maybe you can delete it to make your code look neater?
3
I like the way you separated the code over here! It makes it easier to read the long sentence.
4
perhaps there could be a spacing here? like try { instead of try{
but I'm pretty sure this is just a careless mistake so don't worry too much about it!
5
I like the way you abstracted these!
@Jacob-Pang
(4 comments)1
Would it be better to set default value false for Task so that the subclasses do not require setting it in their respective constructors?
2
Is the syntax "this" necessary for calling the echo method?
3
I like your use of the StringBuilder! Beats concatenation of Strings when output becomes larger. Did you choose to write the entire output at once over line by line for performance reasons?
4
Is the type inference with var necessary since it is assigned to Dialog?
@jingxueguo
(4 comments)1
do you think maybe switch statements could be used to make the code look more concise?
2
Maybe some java docs will be useful to make the user understand the code better!
3
I think it is great that you implemented Duke Exceptions early!
4
I think it's good that you kept the line of print statement short:>
@hojiefeng
(4 comments)1
Same comment as before.
2
Also the same as before
3
Magic number, could use an enum or static variable in the class
4
Would it be better if the input were to be split into two types? One that adds tasks, and the other type does not. It would reduce the total line count of the function, making it easier to read.
@AhQuanz
(4 comments)1
Hi, i think maybe you should refactor the code to improve readability as the method is very long.
The recommended guideline would be not to go beyond 30 LOC (lines of code)
2
Hi , maybe you should create a named constant for these responses for better readability as recommended in Section 5.4e
3
Hi, maybe you should throw an exception here? Leaving it blank may result in future bugs.
4
Hi, very nice use of SLAP to keep in within 30 LOC
@Bennyphoe
(4 comments)1
main class code may seem quite cluttered with many functions, maybe its possible to move the task related methods in to the TaskList class since all the methods are related to handling the list of task?
2
lacks a @return param
3
should be for (int i = 0; i >listOfTasks.size(); i++) just the indentation for i=0 does not follow convertions
4
should have a spacing between '+ ' operator
@jamesleeht
(4 comments)1
No empty line here necessary as well as some other areas.
2
Maybe could rename to sayBye() instead to make it closer to a verb?
3
According to coding standard, it's not good to have single letter variables. Maybe this can be called "exception" instead?
4
According to coding standard, there shouldn't be an extra line of space here.
@arihantjain97
(4 comments)1
Good import practices.
If possible, its good practice to do packaging and javadoc.
2
Good usage of switch statements! easy to read and follows code conventions
3
Good practice to javadoc this class as well 😃
4
Good naming convention! Overall all classes, easy to read and follow. Just missing packaging and javadocs! Great job
@kieron560
(4 comments)1
Hi, I believe there should be punctuation at the end of the description, based on the javadocs
2
Should you have @params and @returns here?
3
I think there should be punctuations behind the parameter description? As per the Java Coding Standards.
4
Should you add a JavaDocs here?
@dvdweien
(4 comments)1
perhaps the deadline class does not need to be public? As deadline class is only accessed within the package. I think some of the other classes do not have to be public as well.
2
Perhaps DukeException does not need to be public? As DukeException would not be used outside of the package, I think the other exceptions do not need to be public as well
3
perhaps a javadoc might be needed as it is a public class
4
Perhaps there should be javadoc since it is a public method?
@zoeykobe
(3 comments)1
I would prefer to use date
instead of dateTime
, as dateTime suggests that the information also includes a time element
2
Should there be a @return and @throws comment here?
3
Should there be a @return here as well?
@ssagit
(3 comments)1
[Code Standard] Should have {} for all if() statements
2
[Code Standard] Should have {} for all if() statements
3
[Code Standard] Line length should be no longer than 120 chars
@Juzzanoob
(3 comments)1
Perhaps delete could be renamed to deleteTask too, just to ensure clarity?
2
I like how you indicate the valid commands to the user!
3
Perhaps "deletedMessage" can be changed into "deletedTaskMessage"? Just so that others won't get confused if the deletedMessage variable appears later and they are confused that it refers to a deleted message.
@CSjiade
(3 comments)1
Hi sir for this function should it be public too just like the rest of the functions?
PS: I may be wrong here
2
Hi sir for this function should it be public too just like the rest of the functions?
PS: I may be wrong here
3
Will saveTasks be better here?
@linhns
(3 comments)1
Perhaps you can consider splitting this into 2 lines?
2
Should this be named "deleteCommand "instead?
3
Should this be "respond" instead of "response"?
@mechastriker3
(3 comments)1
Your code is overall really clean and neat so there is nothing much to comment on. But if I'm being super nit-picky, if I'm not wrong, I think the past tense of split is still split so splitted might cause some confusion? If not there is really nothing much to say 😃 Great Job !!!!
2
Should the method name start with small letters? So would it be better if it was greet()
instead of Greet()
3
Same for this method, should the method name be exit()
instead of Exit()
@JonahhGohh
(3 comments)1
Additional punctuation at the end of the description.
2
Maybe you could consider closing your scanner after you are done reading the file?
3
Would "Executes relevant command instructions based on user input" be better here? "Handles and makes sense" sounds a bit vague when I first read it 😅
@tsh22
(3 comments)1
Perhaps you could add a space between the description and parameter section of the javadocs?
2
Perhaps the opening /** can occupy a whole line on its own and description can be one line down.
3
Should the name of the directory with duke.txt be changed?
@goatygoatygoat
(3 comments)1
Should this be named differently?
2
Perhaps you could describe the circumstances which would cause a DukeException to be thrown?
3
Perhaps you can use the full word "index" as the variable name instead?
@DarkDestry-t
(2 comments)1
I think this test is incredibly effective in ascertaining that 2 is indeed equal to 2.
2
Is there any particular reason you are compiling into the source folders?
@andrea-twl
(2 comments)1
Perhaps this method could be named in a way that makes it clearer that it returns a boolean?
2
Maybe this can be named isNewFile just to follow conventions?
@maikongeh
(2 comments)1
I found you code easy to understand and easy to read. The quality of code was good and you adhered to coding standards. The names of methods were appropriate as well. Keep it up
2
Your code is well written and understandable. Your testing is also rigorous and complete. Keep up the good work!
@rjeez
(1 comments)1
I think dueDate should be used instead of by as the former is more understandable!
@yanlingkuek
(1 comments)1
your tests can be named whatIsBeingTested_descriptionOfTestInputs_expectedOutcome
so that it is a bit clearer
@OhEyeSee
(0 comments)@awzhenyi
(0 comments)@kwmiw
(0 comments)@Yihe-Harry
(0 comments)@Shizheng001
(0 comments)@KnitidCeladon23
(0 comments)@adidoesnt
(0 comments)@CSmortal
(0 comments)@toahi
(0 comments)@HuaiZe
(0 comments)@KevinLohJunYong
(0 comments)@Jacob-109
(0 comments)