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

feat(commands): Add Commands to list White and Blacklists #137

Merged
merged 7 commits into from
Mar 11, 2024

Conversation

thelooter
Copy link
Owner

No description provided.

@thelooter thelooter force-pushed the feat/add-white-and-blacklist-listing branch from 9c08755 to d86136a Compare March 11, 2024 09:25
@thelooter thelooter force-pushed the feat/add-white-and-blacklist-listing branch from d86136a to 0ff7f0a Compare March 11, 2024 09:39
The EventCheckerCommand has been simplified by extracting command handling into a separate method. The command had previously only allowed listing of 'all' events. Now the 'list' command accepts 'all', 'blacklist', and 'whitelist' as parameters. EventCheckerCommandCompleter code was updated accordingly to reflect these changes.
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 63.38028% with 26 lines in your changes are missing coverage. Please review.

Project coverage is 71.67%. Comparing base (4dbd38a) to head (dc72436).

Files Patch % Lines
...ooter/eventchecker/commands/EventCheckerCommand.kt 55.76% 15 Missing and 8 partials ⚠️
.../commands/complete/EventCheckerCommandCompleter.kt 82.35% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #137      +/-   ##
============================================
- Coverage     79.52%   71.67%   -7.86%     
- Complexity       41       56      +15     
============================================
  Files             6        6              
  Lines           127      173      +46     
  Branches         18       29      +11     
============================================
+ Hits            101      124      +23     
- Misses           11       27      +16     
- Partials         15       22       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This update refactors the EventCheckerCommand to simplify its structure and enhance its functionality. By creating a separate 'sendEvents' method, redundant code is eliminated. Moreover, the 'list' command now accepts three parameters - 'all', 'blacklist', and 'whitelist' - improving navigation through different event categories.
This commit improves the structure and functionality of the EventCheckerCommand in the Kotlin codebase. It introduces a new 'handleNonExistentPage' method to remove duplicated code and simplify error handling. Additionally, the 'list' command now handles three parameters more efficiently, improving user navigation within event categories.
This commit introduces a helper method 'handlePartition' to simplify management of partitions in the EventCheckerCommand. It replaces redundant code in both blacklist and whitelist sections, improving readability and maintainability of the code. The 'partition' variable is checked using a more idiomatic call, 'isEmpty()', enhancing code clarity.
Introduced methods 'handleEmptyPartition' and 'isListTypeEnabled' to simplify validation of list types and corresponding partitions. This refactoring enhances the readability and maintainability by eliminating repetitive code for 'all', 'blacklist', and 'whitelist' list types. It also improves the handling and messaging around empty or disabled list types.
The error message in the EventCheckerCommand class and the EventCheckerCommandTest class has been updated to include all, blacklist, and whitelist as options for the list command. This update ensures a more accurate and helpful error message to guide the user when using the 'list' command.
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@thelooter thelooter merged commit fa3b765 into main Mar 11, 2024
4 of 6 checks passed
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