-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve code quality #304
Improve code quality #304
Conversation
* 'master' of github.com:AY2324S2-CS2103T-W10-2/tp: Fix pin edit bug
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.
LGTM
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.
LGTM
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.
Just a few comments from me, otherwise lgtm!
- There are many repeated comments and I have tried my best to comment at all occurrences of the repeated errors, however I may have missed a few so please check through all again.
requireNonNull
seems to be used in conjunction withassert
for a few commands, but are missing for other commands. Might want to standardise this.
@@ -35,30 +35,44 @@ public class AddCommandParser implements Parser<AddCommand> { | |||
|
|||
/** | |||
* Parses the given {@code String} of arguments in the context of the AddCommand | |||
* and returns an AddCommand object for execution. | |||
* and returns an AddCommand object for execution. Parameter args cannot be null. |
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.
should be @{code args}
instead of 'args'
@@ -39,31 +39,46 @@ public class AddMaintainerCommandParser implements Parser<AddMaintainerCommand> | |||
private final Logger logger = LogsCenter.getLogger(getClass()); | |||
/** | |||
* Parses the given {@code String} of arguments in the context of the AddStaffCommand | |||
* and returns an AddCommand object for execution. | |||
* and returns an AddCommand object for execution. Parameter args cannot be null. |
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.
same comment here on args
@@ -39,31 +39,46 @@ public class AddStaffCommandParser implements Parser<AddStaffCommand> { | |||
|
|||
/** | |||
* Parses the given {@code String} of arguments in the context of the AddStaffCommand | |||
* and returns an AddCommand object for execution. | |||
* and returns an AddCommand object for execution. Parameter args cannot be null. |
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.
same comment here on args
@@ -38,29 +38,44 @@ public class AddSupplierCommandParser implements Parser<AddSupplierCommand> { | |||
private final Logger logger = LogsCenter.getLogger(getClass()); | |||
/** | |||
* Parses the given {@code String} of arguments in the context of the AddStaffCommand | |||
* and returns an AddCommand object for execution. | |||
* and returns an AddCommand object for execution. Parameter args cannot be null. |
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.
same comment here on args
@@ -23,30 +23,32 @@ public class DeleteCommandParser implements Parser<DeleteCommand> { | |||
|
|||
/** | |||
* Parses the given {@code String} of arguments in the context of the DeleteCommand | |||
* and returns a DeleteCommand object for execution. | |||
* and returns a DeleteCommand object for execution. Parameter args cannot be null. |
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.
same here
@@ -26,28 +26,30 @@ public class RateCommandParser implements Parser<RateCommand> { | |||
|
|||
/** | |||
* Parses the given {@code String} of arguments in the context of the RateCommand | |||
* and returns a RateCommand object for execution. | |||
* and returns a RateCommand object for execution. Parameter args cannot be null. |
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.
same comment here on args
@@ -26,28 +26,30 @@ public class RateCommandParser implements Parser<RateCommand> { | |||
|
|||
/** | |||
* Parses the given {@code String} of arguments in the context of the RateCommand | |||
* and returns a RateCommand object for execution. | |||
* and returns a RateCommand object for execution. Parameter args cannot be null. | |||
* | |||
* @throws ParseException if the user input does not conform the expected format |
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.
same comment here on missing preposition "to"
logger.log(Level.INFO, "Going to start parsing for rate command."); | ||
ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(args, PREFIX_NAME, PREFIX_RATING); |
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.
should have empty line before this to separate from logging code block
@@ -17,34 +17,30 @@ public class SearchCommandParser implements Parser<SearchCommand> { | |||
|
|||
/** | |||
* Parses the given {@code String} of arguments in the context of the SearchCommand | |||
* and returns a SearchCommand object for execution. | |||
* and returns a SearchCommand object for execution. Parameter args cannot be null. | |||
* @throws ParseException if the user input does not conform the expected format |
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.
same comment here on missing preposition "to"
* Parses the given {@code String} of arguments in the context of the PinCommand | ||
* and returns an PinCommand object for execution. | ||
* Parses the given {@code String} of arguments in the context of the UnpinCommand | ||
* and returns an UnpinCommand object for execution. Parameter args cannot be null. |
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.
same comment here on args
Improve code quality by adding assert statements.
I also helped to standardise commenting and code separations.