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

Refactor: Command: Purge - Reduce Cognitive Complexity #110

Open
ctsstc opened this issue Apr 20, 2020 · 0 comments
Open

Refactor: Command: Purge - Reduce Cognitive Complexity #110

ctsstc opened this issue Apr 20, 2020 · 0 comments

Comments

@ctsstc
Copy link
Member

ctsstc commented Apr 20, 2020

Currently the purge command is contained all in a single method with a lot of if blocks and nested logic.

Code Climate reports this file to have a cognitive complexity of 9 out of threshold of 5.

After getting tests in place for it from issue #31 & PR #107 this should be refactored to reduce the complexity. We should be able to accomplish this by splitting logic out into additional methods and trying to reduce nested if statements if possible.

The pain is not knowing how to test the cognitive complexity locally, so we'll have to push it up to see what code climate things about it unfortunately.

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

No branches or pull requests

1 participant