Updated

app/helpers / form_helper.rb

A
18 lines of codes
3 methods
10.3 complexity/method
8 churn
30.93 complexity
0 duplications
module FormHelper
  1. FormHelper has no descriptive comment
def form_row opts={}, &block css_classes = ['form-group'] css_classes.push opts[:class] if opts[:class]
  1. FormHelper#form_row calls 'opts[:class]' 2 times
  2. FormHelper#form_row refers to 'opts' more than self (maybe move it to another class?) Locations: 0 1
css_classes.push 'error' if opts[:for] && opts[:for][0].errors[opts[:for][1]].any?
  1. FormHelper#form_row calls 'opts[:for]' 3 times
  2. FormHelper#form_row refers to 'opts' more than self (maybe move it to another class?) Locations: 0 1
content_tag :div, capture(&block), :class => css_classes.join(' ') end def countries_for_select
  1. FormHelper#countries_for_select doesn't depend on instance state (maybe move it to another class?)
Location.menu end def error_messages_for_field(object, field_name, options = {}) if errors = object && object.errors[field_name].presence content_tag :span, errors.first, { class: 'error-message' }.merge(options) end end end