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-CS2113-T13-3] Chronologer #34

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

Conversation

hanskw4267
Copy link

@hanskw4267 hanskw4267 changed the title [AY1920S1-CS2113-T13-3] Duchess [AY1920S1-CS2113-T13-3] Chronologer Sep 11, 2019
x3chillax referenced this pull request in x3chillax/main Oct 16, 2019
Copy link

@RubaP RubaP left a comment

Choose a reason for hiding this comment

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

As a team, please go through the comments even if it is related to one person's code. I havent repeated pointing out the same mistake. In design, I have the same confusion that I raised in UG and DG feedback. It is not very clear why there are so many classes with minor attribute variations (or without any difference). In case, If these class will have behavioural changes in future then it should be fine. Otherwise, it is pointless to create so many classes with minor/no difference.

}

/**
* The getUserDialog distinction is needed to enable the flipping of the labels to create the chat bot like
Copy link

Choose a reason for hiding this comment

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

The method comment should start with a simple present. Once you explain 'what it does' in the first sentence, then you can explain 'why' or any other important information to be conveyed

Choose a reason for hiding this comment

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

Corrected.

+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);

private String filePath = System.getProperty("user.dir") + "/src/DukeDatabase/ArrayList";
Copy link

Choose a reason for hiding this comment

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

The magical strings should be defined as a constant. Even if the filePath changes somewhere in the middle of the process, the magical postfix can be defined as a constant with the name indicating it is a default one

}

/**
* This method runs the main program.
Copy link

Choose a reason for hiding this comment

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

This should be 'Runs the main program'. I will not point out the same mistake in the method comment in the following implementation. Please make sure it is fixed everywhere.

Choose a reason for hiding this comment

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

The class was rendered redundant, fixed this issue across the project

FXMLLoader fxmlLoader = new FXMLLoader(Main.class.getResource("/view/MainWindow.fxml"));
AnchorPane ap = fxmlLoader.load();
Scene scene = new Scene(ap);
stage.getIcons().add(new Image(getClass().getResourceAsStream("/images/GuiLogo.png")));
Copy link

Choose a reason for hiding this comment

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

This method does not flow SLAP though it is very short. If start method does a functionality at the level of calling someone else's method (e.g. initializeDukeElements() ), then it should be maintained throughout the method. But here it does a very lower-level work of creating and setting object properties

Scene scene = new Scene(ap);
stage.getIcons().add(new Image(getClass().getResourceAsStream("/images/GuiLogo.png")));
stage.setScene(scene);
stage.setTitle("Chronologer");
Copy link

Choose a reason for hiding this comment

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

Please define these magical strings as constants

duration = ChronoUnit.HOURS.between(LocalDateTime.now(), dateList.get(i).startDate);
}
if (durationToFind <= duration) {
if (i != 0) {
Copy link

Choose a reason for hiding this comment

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

There are three levels of if here which is very hard to read and understand. Try to simplify it

public static String wrongDateOrTime() {
Ui.printManual();
Ui.printDash();
return "☹ OOPS!!! The date or time of this add type command is not of the correct format."
Copy link

Choose a reason for hiding this comment

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

Magical strings?

public static DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("dd/MM/yyyy HHmm");
private static LocalDateTime dateEvent;
private static LocalDateTime dateDeadline;
private static LocalDateTime datePostpone;
Copy link

Choose a reason for hiding this comment

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

If you want to only assign and return, what is the purpose of having this many variables of same type. If you have any future use, then it should be fine.

BY("/by"),
AT("/at"),
BETWEEN("/between"), FOR("/for"),
IN("/in");
Copy link

Choose a reason for hiding this comment

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

Good

* @throws DukeException The DukeException class has all the respective methods
* and messages!
*/
public static Command parse(String userInput) throws DukeException {
Copy link

Choose a reason for hiding this comment

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

Too lengthy to read and follow what it does. Try to simplify this by extracting out low-level operation to methods.

TanYiXiang and others added 23 commits November 1, 2019 13:35
# Conflicts:
#	src/main/java/chronologer/command/ExportCommand.java
Implemented a history like feature for the chatbot.
TanYiXiang and others added 29 commits November 11, 2019 17:27
Added test cases and did quite a few bug fixes.
added commands for testing purpose
DG & UG update after module lead approval.
nishanthelango pushed a commit to nishanthelango/Duchess that referenced this pull request Nov 23, 2021
* test

* test

* test

* test

* test

* test

* test

* image

* image

* image

* image

* update

* update

* update

* update

* update
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