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

[AY1920S1-CS2113T-F10-2] Duke 2.0 #36

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

Conversation

zyleet
Copy link

@zyleet zyleet commented Sep 12, 2019

x3chillax referenced this pull request in x3chillax/main Oct 16, 2019
* B-Reminders

* B-reminders modification

* duke.java

* modified buidl.gradle and Command

* user guide

* user guide table of contents

* user guide link TOC

* user guide

* UI

* corrected mock UI

* rename UI

* UI update
Copy link

@jtankw3 jtankw3 left a comment

Choose a reason for hiding this comment

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

Nice job! The code is quite clean and well done. Also good job on including test code. Do try to follow the commenting guidelines and not include too much information in your comments. Also remember that comments for methods should be in simple present tense.

Some code looks like it is repeated many times. See if you can apply some abstraction techniques.

Please close this pr after you have read the comments.

private String arguments;
private String command;
private Memento memento;
private int listType = 0; //0 for task list, 1 for degree list
Copy link

Choose a reason for hiding this comment

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

Magic numbers

* @since 09/19
*/
public abstract class Command {
boolean exit = false;
Copy link

Choose a reason for hiding this comment

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

boolean should have boolean name

import list.DegreeList;

/**
* AddCommand Class extends the abstract Command class.
Copy link

Choose a reason for hiding this comment

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

Comments should focus on what the code is supposed to do. You should not include excess information that may be redundant. (extends can be seen from AddCommand extends Command)

TaskList tasksBuffer;
DegreeList degreesBuffer;

if (this.command.matches("event")) {
Copy link

Choose a reason for hiding this comment

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

This code seems repetitive. Is there a way to abstract?

}

/**
* overwrites default execute to add tasks.
Copy link

Choose a reason for hiding this comment

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

Describe what the method does. You can use @OverRide to show the override instead of writing in the comment description.

* @param mc is the credit amount of a module
*/
public Module(String code, String name, Integer mc)
{
Copy link

Choose a reason for hiding this comment

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

Brace position

try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(this.saveFile))) {
for (int i = 0; i < list.size(); i++) {
String fileContent = list.get(i).getType() + " | "
+ (list.get(i).checkCompletion() ? "1" : "0") + " | " + list.get(i).getDescription();
Copy link

Choose a reason for hiding this comment

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

The statement is quite complex, can it be simplified to be more understandable with refactoring?

for (int i = 0; i < splitTasks.length; i++) {
String[] split = splitTasks[i].split(Parser.taskSeparator);
switch (split[0]) {
case "T":
Copy link

Choose a reason for hiding this comment

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

Magic strings

*/
public After(String description) throws DukeException {
String[] split = description.split(Parser.after);
if (split.length < 2) {
Copy link

Choose a reason for hiding this comment

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

This code seems to be repeated in many classes is there a way to abstract?

class ExitCommandTest {

private Command testCommand = new ExitCommand();
private TaskList testTaskList = new TaskList("T | 0 | Send even more Help\n"
Copy link

Choose a reason for hiding this comment

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

If you use this for a lot of tests you may want to abstract it out as a test utility

zyleet and others added 24 commits November 3, 2019 02:28
… into AY1920S1-CS2113T-F10-2-master

# Conflicts:
#	classes/java/main/degree/Degree.class
#	classes/java/main/module/Module.class
#	classes/java/main/module/ModuleList.class
#	src/main/java/degree/Degree.java
#	src/main/java/degree/DegreeManager.java
#	src/main/java/module/ConjunctiveModule.java
#	src/main/java/module/ModuleList.java
* 'master' of https://github.com/manaswini05/main:
  Finish All 4 tables
  Merge branch 'master' of https://github.com/AY1920S1-CS2113T-F10-2/main into AY1920S1-CS2113T-F10-2-master
  fix gui resize bug
  prep for diff and similar checking
  prep for diff checking
  fix minor bugs
  udpate javadoc
  finish tables for all lists
  fix autosuggest recording typos
  prep for degree information
  add table view for task and choices
  add table support for task
fix removeDegreeTasks in UniversityTaskHandler.java
implement support for saving taskPriority
remove support for After, Fixed, Recurring, and Within Tasks
nishanthelango pushed a commit to nishanthelango/Duchess that referenced this pull request Nov 23, 2021
* Remove instanceof from ReminderCommand

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

Successfully merging this pull request may close these issues.

6 participants