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-W13-3] SGTravel #71

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

Conversation

Jefferson111
Copy link

@okkhoy
Copy link
Collaborator

okkhoy commented Oct 14, 2019

@Sukrut1881
@hongchuan97
@Inno97
@Jefferson111

if this is your official PR to the upstream repo, please title it in English!

@Jefferson111 Jefferson111 changed the title [AY1920S1-CS2113T-W13-3] 天気の子見ましたか? [AY1920S1-CS2113T-W13-3] SGTravel Oct 14, 2019
Copy link
Collaborator

@okkhoy okkhoy left a comment

Choose a reason for hiding this comment

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

Overall decent code. However, I could spot quite a few coding std violations. Do take care!

BTW, I didn't see much (any) test code? Please ensure you write test code as and when you implement your features.

mainWindow.show();
mainWindow.initialise(this);
} catch (Exception e) {
e.printStackTrace();
Copy link
Collaborator

Choose a reason for hiding this comment

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

printing stacktrace is not good exception handling

* Messages used by duke.Duke.
*/
public class Messages {
public static final String UNKNOWN_COMMAND = "☹ I'm sorry, but I don't know what that means :-(";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need to follow naming convention here.
Think if you can categorize these commands in some way.

  • are they related to a feature? if so can you name them as Feature_<message type>_<variable>
  • are they related to a particular type of message? e.g. info, error, etc.,

public static final String PROMPT_ERROR = "Sorry, but something went wrong...";
public static final String PROMPT_TOO_MANY_ATTEMPTS = "Sorry, but you have exceeded 5 attempts...";
public static final String PROMPT_SPACES = "Please do not include spaces in your search!";
public static final String PROMPT_NOT_INT = "Please use a number!";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Apply this convention above, can?

@@ -0,0 +1,8 @@
package duke.commons.enumerations;

public enum Constraint {
Copy link
Collaborator

Choose a reason for hiding this comment

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

header comments please!

* Enumerations for different specificity of time.
*/
public enum TimePatternType {
DAY_OF_WEEK, DATE_TIME, DATE, TIME
Copy link
Collaborator

Choose a reason for hiding this comment

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

follow a standard convention to write enums.

* URL request to OneMap API to get coordinates of location.
*/
public class LocationSearchUrlRequest extends UrlRequest {
private static final String paramType = "searchVal";
Copy link
Collaborator

Choose a reason for hiding this comment

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

variable name for "constants" don't follow the guideline

src/main/java/duke/logic/commands/ExitCommand.java Outdated Show resolved Hide resolved
}
return new CommandResultText(MESSAGE_BUS_ROUTE + result);

} catch (Throwable e) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

woah! waay too generic. please use specific exception class

}

/**
* Executes this command on the given task list and user interface.
Copy link
Collaborator

Choose a reason for hiding this comment

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

may want to say what command is "this command"

import duke.logic.commands.results.CommandResultText;
import duke.model.Model;

public class PromptCommand extends Command {
Copy link
Collaborator

Choose a reason for hiding this comment

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

header comments missing

src/main/java/duke/logic/commands/ViewScheduleCommand.java Outdated Show resolved Hide resolved
@@ -0,0 +1,9 @@
package duke.logic.commands.results;

public abstract class CommandResult {
Copy link
Collaborator

Choose a reason for hiding this comment

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

abstract classes MUST have header comments. it is like a contract between the component and the client class.
how will the client class implementer know what to expect without documentation?


import javafx.scene.image.Image;

public interface Imageable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is imageable?

Copy link
Author

@Jefferson111 Jefferson111 Oct 22, 2019

Choose a reason for hiding this comment

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

We are unsure of how to name the interface, it is to mean the class that implements the interface should contains an Image and a method to get the image


import duke.model.TaskList;

public interface Taskable {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is taskable?

Copy link
Author

@Jefferson111 Jefferson111 Oct 22, 2019

Choose a reason for hiding this comment

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

We are unsure of how to name the interface, it is to mean the class that implements the interface should contains tasks and a method to get/set the tasks.

/**
* Creates a Conversation object based on input.
*
* @param input The words from user input.
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to advertise the exception being thrown

src/main/java/duke/model/events/Event.java Outdated Show resolved Hide resolved
@@ -0,0 +1,70 @@
package duke.model.transports;

import duke.commons.enumerations.Constraint;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this part of the code looks well written 👍

boolean isBusData = false;
while (s.hasNext()) {
String line = s.nextLine();
if ("==========".equals(line)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

?? any specific reason? do you want to document?

import duke.model.events.Task;
import duke.model.events.TaskWithDates;
import duke.ui.UiPart;
import javafx.fxml.FXML;
Copy link
Collaborator

Choose a reason for hiding this comment

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

give a line space to indicate logical grouping of imports.


private LocationCard(Venue location) {
super(FXML);
double offsetY = 600 - ((location.getLatitude() - 1.218) * 600 / (1.486 - 1.218));
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you make this size agnostic? things many not appear the same way on all resolution screens

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