app/models/legislation/process.rb

Summary

Maintainability
A
0 mins
Test Coverage

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

    Legislation::Process::Phase.new(allegations_start_date, allegations_end_date, allegations_phase_enabled)
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

  PHASES_AND_PUBLICATIONS = %i(debate_phase allegations_phase proposals_phase draft_publication result_publication).freeze
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

      errors.add(:debate_end_date, :invalid_date_range) if debate_end_date && debate_start_date && debate_end_date < debate_start_date
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

  has_many :questions, -> { order(:id) }, class_name: 'Legislation::Question', foreign_key: 'legislation_process_id', dependent: :destroy
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

  has_one :final_draft_version, -> { where final_version: true, status: 'published' }, class_name: 'Legislation::DraftVersion',
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

      if allegations_end_date && allegations_start_date && allegations_end_date < allegations_start_date
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

  PHASES_AND_PUBLICATIONS = %i(debate_phase allegations_phase proposals_phase draft_publication result_publication).freeze
Severity: Minor
Found in app/models/legislation/process.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)

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

                                               foreign_key: 'legislation_process_id', dependent: :destroy
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

  scope :open, -> { where("start_date <= ? and end_date >= ?", Date.current, Date.current).order('id DESC') }
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

  has_many :proposals, -> { order(:id) }, class_name: 'Legislation::Proposal', foreign_key: 'legislation_process_id', dependent: :destroy
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

    Legislation::Process::Phase.new(proposals_phase_start_date, proposals_phase_end_date, proposals_phase_enabled)
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

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

                                                                                       foreign_key: 'legislation_process_id'
Severity: Minor
Found in app/models/legislation/process.rb by rubocop

There are no issues that match your filters.

Category
Status