app/models/comment.rb

Summary

Maintainability
A
35 mins
Test Coverage

Method build has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def self.build(commentable, user, body, p_id = nil, valuation = false)
Severity: Minor
Found in app/models/comment.rb - About 35 mins to fix

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

      COMMENTABLE_TYPES = %w(Debate Proposal Budget::Investment Poll Topic Legislation::Question
                            Legislation::Annotation Legislation::Proposal).freeze
    Severity: Minor
    Found in app/models/comment.rb by rubocop

    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)

    There are no issues that match your filters.

    Category
    Status