hpi-swt2/workshop-portal

View on GitHub

Showing 494 of 494 total issues

Redundant use of Object#to_s in interpolation.
Open

    "<a class=\"#{'dropup' if is_sorted_ascending}\" href=\"?sort=#{attr.to_s}#{'&order=descending' if is_sorted_ascending}\">

This cop checks for string conversion in string interpolation, which is redundant.

Example:

# bad

"result is #{something.to_s}"

Example:

# good

"result is #{something}"

Line is too long. [86/80]
Open

      redirect_to @application_letter, notice: 'Application was successfully created.'

Put empty method definitions on a single line.
Open

  def edit
  end

This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style).

Note: A method definition is not considered empty if it contains comments.

Example: EnforcedStyle: compact (default)

# bad
def foo(bar)
end

def self.foo(bar)
end

# good
def foo(bar); end

def foo(bar)
  # baz
end

def self.foo(bar); end

Example: EnforcedStyle: expanded

# bad
def foo(bar); end

def self.foo(bar); end

# good
def foo(bar)
end

def self.foo(bar)
end

Don't use IDs in selectors.
Open

#event-date-pickers .close {
Severity: Minor
Found in app/assets/stylesheets/events.css by csslint

Don't use IDs in selectors.
Open

#event-date-pickers .form-control {
Severity: Minor
Found in app/assets/stylesheets/events.css by csslint

Don't use IDs in selectors.
Open

#notice {
Severity: Minor
Found in app/assets/stylesheets/scaffold.css by csslint

Extra empty line detected at class body end.
Open


end
Severity: Minor
Found in app/models/event.rb by rubocop

This cops checks if empty lines around the bodies of classes match the configuration.

Example: EnforcedStyle: empty_lines

# good

class Foo

  def bar
    # ...
  end

end

Example: EnforcedStyle: emptylinesexcept_namespace

# good

class Foo
  class Bar

    # ...

  end
end

Example: EnforcedStyle: emptylinesspecial

# good
class Foo

  def bar; end

end

Example: EnforcedStyle: noemptylines (default)

# good

class Foo
  def bar
    # ...
  end
end

Extra blank line detected.
Open


  # @return the minimum start_date over all date ranges
Severity: Minor
Found in app/models/event.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Use proc instead of Proc.new.
Open

  validate :deadline_cannot_be_in_the_past, :if => Proc.new { |letter| !(letter.status_changed?) }
Severity: Minor
Found in app/models/application_letter.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Don't use parentheses around a method call.
Open

  validate :deadline_cannot_be_in_the_past, :if => Proc.new { |letter| !(letter.status_changed?) }
Severity: Minor
Found in app/models/application_letter.rb by rubocop

This cop checks for redundant parentheses.

Example:

# bad
(x) if ((y.z).nil?)

# good
x if y.z.nil?

Line is too long. [81/80]
Open

    return now.year - birth_date.year - (current_time_is_before_birthday ? 0 : 1)
Severity: Minor
Found in app/models/profile.rb by rubocop

Tab detected.
Open

    return age_at_event_start >= age
Severity: Minor
Found in app/models/user.rb by rubocop

Redundant return detected.
Open

    return self.older_than_required_age_at_start_date_of_event?(given_event, 18)
Severity: Minor
Found in app/models/user.rb by rubocop

This cop checks for redundant return expressions.

Example:

def test
  return something
end

def test
  one
  two
  three
  return something
end

It should be extended to handle methods whose body is if/else or a case expression with a default branch.

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

    if current_user.role == "pupil"
Severity: Minor
Found in app/helpers/application_helper.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Inconsistent indentation detected.
Open

    def set_request
      @request = Request.find(params[:id])
    end

This cops checks for inconsistent indentation.

Example:

class A
  def test
    puts 'hello'
     puts 'world'
  end
end

Put empty method definitions on a single line.
Open

  def edit
  end

This cop checks for the formatting of empty method definitions. By default it enforces empty method definitions to go on a single line (compact style), but it can be configured to enforce the end to go on its own line (expanded style).

Note: A method definition is not considered empty if it contains comments.

Example: EnforcedStyle: compact (default)

# bad
def foo(bar)
end

def self.foo(bar)
end

# good
def foo(bar); end

def foo(bar)
  # baz
end

def self.foo(bar); end

Example: EnforcedStyle: expanded

# bad
def foo(bar); end

def self.foo(bar); end

# good
def foo(bar)
end

def self.foo(bar)
end

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

      render "application_letters/show"

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Unnecessary spacing detected.
Open

    street_name + ", " + zip_code + " " +  city + ", " + state + ", " + country
Severity: Minor
Found in app/models/profile.rb by rubocop

This cop checks for extra/unnecessary whitespace.

Example:

# good if AllowForAlignment is true
name      = "RuboCop"
# Some comment and an empty line

website  += "/bbatsov/rubocop" unless cond
puts        "rubocop"          if     debug

# bad for any configuration
set_app("RuboCop")
website  = "https://github.com/bbatsov/rubocop"

Tab detected.
Open

    return fitting_agreement_letters[0]
Severity: Minor
Found in app/models/user.rb by rubocop

Line is too long. [102/80]
Open

    fitting_agreement_letters = self.agreement_letters.select { |letter| letter.event == given_event }
Severity: Minor
Found in app/models/user.rb by rubocop
Severity
Category
Status
Source
Language