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

Complete A-CodeQuality #3

Merged
merged 1 commit into from
Feb 24, 2024
Merged

Complete A-CodeQuality #3

merged 1 commit into from
Feb 24, 2024

Conversation

ValenciaLim
Copy link
Owner

Parser class: create functions to check for null task number and blank fields.

Null task number and blank fields are handled in multiple switch cases, causing code duplication.

Extracting the common error handling into its corresponding function allow us to reuse the code more efficiently. This also reduces the number of lines the parseCommand method have.

Error handling for null task number is written in the checkNullTaskNum function. Error handling for blank fields i.e. descriptions, due date, start date, end date, keyword are written in the checkBlankField function.

Parser class: create functions to check for null task number and blank
fields.

Null task number and blank fields are handled in multiple switch cases, causing code
duplication.

Extracting the common error handling into its corresponding function
allow us to reuse the code more efficiently. This also reduces the
number of lines the parseCommand method have.

Error handling for null task number is written in the checkNullTaskNum
function. Error handling for blank fields i.e. descriptions, due date,
start date, end date, keyword are written in the checkBlankField
function.
@ValenciaLim ValenciaLim merged commit 4f97817 into master Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant