metamaps/metamaps

View on GitHub
app/helpers/maps_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage

Method has too many lines. [15/10]
Open

  def autocomplete_map_array_json(maps)
    maps.map do |m|
      {
        id: m.id,
        label: m.name,
Severity: Minor
Found in app/helpers/maps_helper.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [11/10]
Open

  def contributor_tip(map)
    output = ''
    if map.contributors.count.positive?
      map.contributors.each_with_index do |contributor, _index|
        user_image = contributor.image.url(:thirtytwo)
Severity: Minor
Found in app/helpers/maps_helper.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

    if map.contributors.count.positive?
Severity: Minor
Found in app/helpers/maps_helper.rb by rubocop

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