app/controllers/proposals_controller.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Class ProposalsController has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

class ProposalsController < ApplicationController
  include FeatureFlags
  include CommentableActions
  include FlagActions

Severity: Minor
Found in app/controllers/proposals_controller.rb - About 2 hrs to fix

    Line is too long. [108/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          params.require(:proposal).permit(:title, :question, :summary, :description, :external_url, :video_url,

    Line is too long. [112/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        redirect_to proposal_path(@proposal), status: :moved_permanently if request.path != proposal_path(@proposal)

    Line is too long. [111/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                                           :responsible_name, :tag_list, :terms_of_service, :geozone_id, :skip_map,

    Line is too long. [121/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          @proposal.errors.add(:retired_reason, I18n.t('errors.messages.blank')) if params[:proposal][:retired_reason].blank?

    Line is too long. [131/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          @proposal.errors.add(:retired_explanation, I18n.t('errors.messages.blank')) if params[:proposal][:retired_explanation].blank?

    Line is too long. [129/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                                           documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],

    Line is too long. [155/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          return unless !@advanced_search_terms && @search_terms.blank? && @tag_filter.blank? && params[:retired].blank? && @current_order != "recommendations"

    Line is too long. [125/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                                           image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],

    Line is too long. [126/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

            @resources = @resources.where(retired_reason: params[:retired]) if Proposal::RETIRE_OPTIONS.include?(params[:retired])

    Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          if map_location && (map_location[:longitude] && map_location[:latitude]).blank? && !map_location[:id].blank?

    %w-literals should be delimited by [ and ]. (https://github.com/bbatsov/ruby-style-guide#percent-literal-braces)
    Open

      has_orders %w{most_voted newest oldest}, only: :show

    This cop enforces the consistent usage of %-literal delimiters.

    Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

    Example:

    # Style/PercentLiteralDelimiters:
    #   PreferredDelimiters:
    #     default: '[]'
    #     '%i':    '()'
    
    # good
    %w[alpha beta] + %i(gamma delta)
    
    # bad
    %W(alpha #{beta})
    
    # bad
    %I(alpha beta)

    Line is too long. [105/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        @related_contents = Kaminari.paginate_array(@proposal.relationed_contents).page(params[:page]).per(5)

    There are no issues that match your filters.

    Category
    Status