fga-gpp-mds/2017.1-OndeE-UnB

View on GitHub
darcyWeb/app/helpers/admin_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for options_for_levels_with_plans is too high. [16.61/15]
Open

  def options_for_levels_with_plans(plans, building, selected_level)
    options = []
    plans.each do |plan|
      display = "#{plan.building.acronym} - NĂ­vel #{plan.level}"
      selected = false

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Line is too long. [148/100]
Open

      options.push([display, plan.building.id, { data: { selected: selected, level: plan.level, image: plan.image_url, geo_data: plan.geo_data } }])

Favor modifier if usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
Open

      if plan.building == building && plan.level == selected_level

Checks for if and unless statements that would fit on one line if written as a modifier if/unless. The maximum line length is configured in the Metrics/LineLength cop.

Example:

# bad
if condition
  do_stuff(bar)
end

unless qux.empty?
  Foo.do_something
end

# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?

There are no issues that match your filters.

Category
Status