Skip to content

Instantly share code, notes, and snippets.

@sjgjohnston
Last active December 26, 2015 19:59
Show Gist options
  • Save sjgjohnston/7205266 to your computer and use it in GitHub Desktop.
Save sjgjohnston/7205266 to your computer and use it in GitHub Desktop.
Code Refactoring Feedback on Miriam's Project 1

Refactoring Feedback:

I didn't get time to examine the detailed action flow of your code to offer detailed logic improvements, if any exist. Just following the guidelines I created the following...

GIT Project issues:

  • Need to delete README.rdoc and create a new README.md
  • You made commit comments in German - should be English for other devs to understand summary of scope of change
  • You should add .DS_Store to your .gitignore file so that is is not committed by default.

Flow:

  • routes.rb
    • redundant code: You have both "root to: 'hamptons#index'" and "get '/', to: 'hamptons#index'" - these do the same thing.
    • Non RESTful routes (about, contact) and corresponding actions in hamptons_controller.rb

Code:

  • Comments

    • ... in German (example application_controller.rb)
    • ... missing commments in some places where clarification would be helpful * example: purpose of 'include Yelp::V2::Search::Request' in hamptons_controller.rb and restaraunts controller.rb
  • Old commented code:

    • Numerous instances of commented-out old code.
      • Example: restaraunts_controller.rb
  • Indentation:

    • Numerous instances of 'hard-to-read' indentation.
      • Example: restaraunts_controller.rb
  • Models/Controllers:

    • Thin models, with fatter controllers:
      • Example: app/controllers/restaurants_controller.rb: 'index' and 'new' actions
    • empty model files (except for one for Sessions).
    • Perhaps it is possible to move some of the code/business logic from the controllers into the related helpers and/or models
  • Helpers:

    • Redundant code:
      • You created a bunch of apps/helper/_helper.rb files that are unused.
        • Not sure if these are placeholders for intended refactoring?
  • Views:

    • You are not adding 'id' attributes for form element tags - this would be helpful for DOM/js manipulation etc...
      • Example: app/views/users/new.html.erb
    • Not using form helpers.
  • Testing:

    • No evidence of TDD (RSpec etc...) - only minimal test scope on the mailer
@MiriamNeubauer
Copy link

Git Project Issues:

projectspecific readmerdoc added, DS_store added,

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