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

Code refactor #155

Open
samhstn opened this issue Mar 23, 2017 · 0 comments
Open

Code refactor #155

samhstn opened this issue Mar 23, 2017 · 0 comments

Comments

@samhstn
Copy link
Contributor

samhstn commented Mar 23, 2017

There is currently very little documentation, we should look to utilise Elixirs documentation generation

We should look to add far more test helpers to get rid of repeated code and make each test more readable

We should look to do less logic inside of the templates directory and instead pass down helpers from the views

We should look to employ brunch to ensure the correct amount of js is run on each webpage to improve website speed (e.g. we're loading jQuery on every page, dispite a lot of views not using jQuery)

Functions inside of the following controllers are in need of being refactored:

  • forgot_pass
  • admin
  • group
  • student
  • survey
  • session

Refactoring would include:

  • Ensuring everything is aliased
  • String concatenation is done consistently
  • Improving functions by using more of the elixir api
  • Abstracting out common patterns
  • Taking out large static data appropriately (controllers/survey has a massive form function, this should be in it's own file)
  • Looking to use more piping instead of being imperative
  • Ensure each helper is unit tested

We could also look at getting a linter: dogma and credo and maybe implement some kind of pre-commit hook to go with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant