-
Notifications
You must be signed in to change notification settings - Fork 252
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
base: master
Are you sure you want to change the base?
[AY1920S1-CS2113T-W13-3] SGTravel #71
Conversation
@Sukrut1881 if this is your official PR to the upstream repo, please title it in English! |
There was a problem hiding this 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.
src/main/java/duke/Main.java
Outdated
mainWindow.show(); | ||
mainWindow.initialise(this); | ||
} catch (Exception e) { | ||
e.printStackTrace(); |
There was a problem hiding this comment.
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 :-("; |
There was a problem hiding this comment.
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!"; |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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
} | ||
return new CommandResultText(MESSAGE_BUS_ROUTE + result); | ||
|
||
} catch (Throwable e) { |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
header comments missing
@@ -0,0 +1,9 @@ | |||
package duke.logic.commands.results; | |||
|
|||
public abstract class CommandResult { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is imageable?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is taskable?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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
@@ -0,0 +1,70 @@ | |||
package duke.model.transports; | |||
|
|||
import duke.commons.enumerations.Constraint; |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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
@Sukrut1881
@hongchuan97
@Inno97
@Jefferson111