Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wu Yujin] iP #155

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open

Conversation

SherryWu178
Copy link

No description provided.

* branch-Level-9:
  Add find function
* branch-A-JavaDo:
  Add Javadoc for some methods

# Conflicts:
#	src/main/java/tasks/Task.java
* A-CodingStandard:
  Fix syntax error

# Conflicts:
#	src/main/java/parser/Parser.java
#	src/main/java/ui/Ui.java
Copy link

@erisjacey erisjacey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I really like the fact that you have organised your code neatly into their respective packages.

That being said, I hope my suggestions (mostly touching on coding style) will be helpful to you 😄

}

/**
* Run a Duke object while isExit is not changed to true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be Runs instead of Run?

Comment on lines 2 to 5
import main.java.tasklist.*;
import main.java.ui.*;
import main.java.storage.*;
import main.java.tasks.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you could import each class that you would require explicitly instead of using wildcard imports?

Comment on lines 43 to 44
return (type.equals(command.type))&&(description.equals(command.description))
&&(date == date||date.equals(command.date));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps there could be spaces between each expression and its operator?

For example, line 43 could be changed to:

return (type.equals(command.type)) && (description.equals(command.description))

import main.java.ui.Ui;

/**
* A command object containing information parsed from an Ui object

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this line could start with * Contains information ...?

Comment on lines 4 to 5
import main.java.tasks.*;
import main.java.tasklist.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you could import each class that you would require explicitly instead of using wildcard imports?

}

@Override
public String data() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this could be renamed to getData()?

protected boolean hasTime;
protected static int numberOfTasks = 0;


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this single line break could be removed?

Comment on lines 29 to 96
* Reduce the count of tasks
*/
public static void reduceOneTasks() {
numberOfTasks--;
}

/**
* Get the tick or cross sign which indicates is a task is complete
* @return
*/
public String getStatusIcon() {
return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols
}

public boolean getHasTime(){
return hasTime;
}

public LocalDate getTime(){
return null;
}

public String getDescription(){
return description;
}


/**
* mark a task as finished
* @return
*/
public Task markAsDone() {
this.isDone = true;
return this;
}

@Override
public String toString() {
return "[" + getStatusIcon() + "] " + description;
}

/**
* Return the message when a task is marked as done
* @return mark-as-done Message
*/
public String markAsDoneMessage() {
return "Nice!(^∇^) I've marked this task as done:\n"
+ this.toString().replace("\u2718", "\u2713");
}

/**
* Return the message when a new task is added
*/
public String addMessage() {
return "Got it.(^∇^) I've added this task:\n"
+ this.toString();
}

/**
* Return the message when a task is deleted
*/
public String deleteMessage() {
return "Got it.(^∇^) I've deleted this task:\n"
+ this.toString();
}

/**
* Return info about the task in the format for data storage

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a similar issue wrt Javadoc comment leading words in several other places.

Comment on lines 55 to 74
* Show all the tasks that are still in the list
* @param taskList
*/

public void showTask(TaskList taskList) {
if (taskList.getTasks().size() == 0) {
System.out.println("This is no task in your task list yet. Add one now! (/^▽^)/");
}

int no = 1;
for (Task task : taskList.getTasks()) {
String prefix = task.toString().substring(0, 7);
String end = task.toString().substring(7);
System.out.println(prefix + no + ". " + end);
no++;
}
}

/**
* Show the tasks on certain day

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a similar issue elsewhere regarding Javadoc comments.

@@ -0,0 +1,34 @@
package test.java.parser;

import main.java.commands.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed a similar issue with import wildcards in other places.

Copy link

@zhizhizhizhizhi zhizhizhizhizhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job overall! Can take note of the common styling issues such javadocs, whitespace before blocks and wildcard imports.

Comment on lines 3 to 5
import main.java.tasklist.*;
import main.java.ui.*;
import main.java.storage.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try not to use .* imports.

String[] info = line.split(" \\| ");
String type = info[0];
int complete = Integer.parseInt(info[1]);
String title = info[2];

switch(type) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps you can include a default case for switch statements.

@@ -55,7 +55,8 @@ public void displayErrorMessage(Exception ex){
* Show all the tasks that are still in the list

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it should be "Shows all...". This is seen in the javadocs comments for other methods in this file and other files too.

public class FindCommand extends Command {
private final String keyword;

public FindCommand(String keyword){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be whitespace before '{'. This is seen in other block statements too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants