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

Improve code quality #304

Merged

Conversation

yleeyilin
Copy link

Improve code quality by adding assert statements.
I also helped to standardise commenting and code separations.

* 'master' of github.com:AY2324S2-CS2103T-W10-2/tp:
  Fix pin edit bug
@yleeyilin yleeyilin added this to the v1.4 milestone Apr 12, 2024
@yleeyilin yleeyilin self-assigned this Apr 12, 2024
Copy link

@Joshy837 Joshy837 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@chiageng chiageng left a comment

Choose a reason for hiding this comment

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

LGTM

@chiageng chiageng merged commit 040010e into AY2324S2-CS2103T-W10-2:master Apr 13, 2024
3 checks passed
Copy link

@jamessinmaojun jamessinmaojun left a 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!

  1. 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.
  2. requireNonNull seems to be used in conjunction with assert 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.

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.

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.

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.

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.

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.

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

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);

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

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.

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

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

Successfully merging this pull request may close these issues.

4 participants