hpi-schuelerklub/workshop-portal

View on GitHub

Showing 208 of 208 total issues

Rule doesn't have all its properties in alphabetical order.
Open

.start-page-pictures .picture-2 {

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

      if @event.has_participants_without_status_notification?(:alternative)

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?

Standard property 'transform' should come after vendor-prefixed property '-moz-transform'.
Open

    -moz-transform: rotate(-5deg);

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

    if end_date < start_date
Severity: Minor
Found in app/models/date_range.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?

Avoid comparing a variable with multiple items in a conditional, use Array#include? instead.
Open

    order_by = 'asc' unless order_by == 'asc' || order_by == 'desc'
Severity: Minor
Found in app/models/event.rb by rubocop

This cop checks against comparing a variable with multiple items, where Array#include? could be used instead to avoid code repetition.

Example:

# bad
a = 'a'
foo if a == 'a' || a == 'b' || a == 'c'

# good
a = 'a'
foo if ['a', 'b', 'c'].include?(a)

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

    if current_user.role == 'admin' || current_user.role == 'organizer'
Severity: Minor
Found in app/helpers/application_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?

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

    if after_deadline?
Severity: Minor
Found in app/models/application_letter.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?

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

    if params[:create].present? || params[:update_and_publish].present?

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?

%w-literals should be delimited by [ and ].
Open

  POSSIBLE_GENDERS = %w(male female other).freeze
Severity: Minor
Found in app/models/profile.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)

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

    if current_user.role == 'pupil'
Severity: Minor
Found in app/helpers/application_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?

Standard property 'transform' should come after vendor-prefixed property '-ms-transform'.
Open

    -ms-transform: rotate(-5deg);

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

      if participant2.agreement_letter_for_event?(self)
Severity: Minor
Found in app/models/event.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?

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

        if number_of_files != 0

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?

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

    unless params.key?(:file)

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?

Standard property 'transform' should come after vendor-prefixed property '-webkit-transform'.
Open

    -webkit-transform: rotate(5deg);

%i-literals should be delimited by [ and ].
Open

  enum status: %i(open accepted declined) # per database declaration, the first value is default
Severity: Minor
Found in app/models/request.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)

%i-literals should be delimited by [ and ].
Open

    %i(first_name last_name gender birth_date street_name zip_code city state country discovery_of_site)
Severity: Minor
Found in app/models/profile.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)

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

    if params[:search]
Severity: Minor
Found in app/controllers/users_controller.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?

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

    if @event.hidden && !can?(:view_hidden, Event)

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?

Symbol with a boolean name - you probably meant to use true.
Open

  validates :number_of_participants_with_previous_knowledge, numericality: { only_integer: true, greater_than_or_equal_to: 0 }, allow_nil: :true
Severity: Minor
Found in app/models/request.rb by rubocop

This cop checks for :true and :false symbols. In most cases it would be a typo.

Example:

# bad
:true

# good
true

Example:

# bad
:false

# good
false
Severity
Category
Status
Source
Language