app/models/debate.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Class Debate has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

class Debate < ActiveRecord::Base
  include Rails.application.routes.url_helpers
  include Flaggable
  include Taggable
  include Conflictable
Severity: Minor
Found in app/models/debate.rb - About 2 hrs to fix

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

          Debate.increment_counter(:cached_anonymous_votes_total, id) if user.unverified? && !user.voted_for?(self)
    Severity: Minor
    Found in app/models/debate.rb by rubocop

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

        orders << "recommendations" if Setting['feature.user.recommendations_on_debates'] && user&.recommended_debates
    Severity: Minor
    Found in app/models/debate.rb by rubocop

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

        orders = %w{hot_score confidence_score created_at relevance}
    Severity: Minor
    Found in app/models/debate.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