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 !insult switch / case #51

Closed
Marak opened this issue Jun 5, 2011 · 0 comments
Closed

Refactor !insult switch / case #51

Marak opened this issue Jun 5, 2011 · 0 comments

Comments

@Marak
Copy link

Marak commented Jun 5, 2011

https://github.com/nodejitsu/kohai/blob/master/lib/plugins/alias.js#L30

This method needs to be refactored.

Insults should be stored as an array of strings in the config.json file. The code for sending insults should only be a few lines long.

The switch / case in this block of code has introduced an anti-pattern. You need to uncouple the data ( insults ) from the logic ( sending insults ).

AvianFlu added a commit that referenced this issue Jun 5, 2011
AvianFlu added a commit that referenced this issue Jun 5, 2011
@AvianFlu AvianFlu closed this as completed Jun 5, 2011
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

2 participants