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

make bot smaller #37

Closed
7 tasks done
ssube opened this issue Dec 4, 2018 · 0 comments
Closed
7 tasks done

make bot smaller #37

ssube opened this issue Dec 4, 2018 · 0 comments
Assignees
Labels
scope/bot status/fixed issues that have been fixed and confirmed type/lint
Milestone

Comments

@ssube
Copy link
Owner

ssube commented Dec 4, 2018

The bot file/class has been flagged by codeclimate as being too long, multiple methods as being too complex, and overall poor quality. This is absolutely a god class with a service locator mixed in. Fix it!

https://codeclimate.com/github/ssube/isolex/src/Bot.ts?strict=false&to_sha=56c871bf2074199f182dec3e8cfb032edd3e47f3

  • service data/option types
    • two service types (filter, listener) are missing their own options, leading to <Foo, {}> types when creating them
    • filter options
    • listener options
  • instance checks
    • there are two clumsy instance checks inside a loop, which should not be necessary
    • command check
    • message check
  • cognitive complexity
    • there are some ugly, complicated methods that need to be simplified
    • receive
    • startServices
  • overall length
    • the Bot itself is too long by a few lines, split parts out
    • service locator
@ssube ssube added status/planned issues that have been planned but not started scope/bot type/lint labels Dec 4, 2018
@ssube ssube added this to the stable milestone Dec 4, 2018
@ssube ssube self-assigned this Dec 4, 2018
@ssube ssube added status/progress issues that are in progress and removed status/planned issues that have been planned but not started labels Dec 7, 2018
@ssube ssube added status/fixed issues that have been fixed and confirmed and removed status/progress issues that are in progress labels Dec 14, 2018
@ssube ssube closed this as completed Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope/bot status/fixed issues that have been fixed and confirmed type/lint
Projects
None yet
Development

No branches or pull requests

1 participant