tansaku/LocalSupport

View on GitHub
app/services/batch_invite_job.rb

Summary

Maintainability
A
0 mins
Test Coverage

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

    User.purge_deleted_users_where(email: @invites.flat_map{ |org_id, email| email.downcase })
Severity: Minor
Found in app/services/batch_invite_job.rb by rubocop

Unused block argument - org_id. If it's necessary, use _ or _org_id as an argument name to indicate that it won't be used. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
Open

    User.purge_deleted_users_where(email: @invites.flat_map{ |org_id, email| email.downcase })
Severity: Minor
Found in app/services/batch_invite_job.rb by rubocop

This cop checks for unused block arguments.

Example:

# bad

do_something do |used, unused|
  puts used
end

do_something do |bar|
  puts :foo
end

define_method(:foo) do |bar|
  puts :baz
end

Example:

#good

do_something do |used, _unused|
  puts used
end

do_something do
  puts :foo
end

define_method(:foo) do |_bar|
  puts :baz
end

Redundant curly braces around a hash parameter.
Open

    User.invite!({email: email}) do |user|
Severity: Minor
Found in app/services/batch_invite_job.rb by rubocop

This cop checks for braces around the last parameter in a method call if the last parameter is a hash. It supports braces, no_braces and context_dependent styles.

Example: EnforcedStyle: braces

# The `braces` style enforces braces around all method
# parameters that are hashes.

# bad
some_method(x, y, a: 1, b: 2)

# good
some_method(x, y, {a: 1, b: 2})

Example: EnforcedStyle: no_braces (default)

# The `no_braces` style checks that the last parameter doesn't
# have braces around it.

# bad
some_method(x, y, {a: 1, b: 2})

# good
some_method(x, y, a: 1, b: 2)

Example: EnforcedStyle: context_dependent

# The `context_dependent` style checks that the last parameter
# doesn't have braces around it, but requires braces if the
# second to last parameter is also a hash literal.

# bad
some_method(x, y, {a: 1, b: 2})
some_method(x, y, {a: 1, b: 2}, a: 1, b: 2)

# good
some_method(x, y, a: 1, b: 2)
some_method(x, y, {a: 1, b: 2}, {a: 1, b: 2})

Unused method argument - current_user. If it's necessary, use _ or _current_user as an argument name to indicate that it won't be used. (https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars)
Open

  def initialize(params, current_user)
Severity: Minor
Found in app/services/batch_invite_job.rb by rubocop

This cop checks for unused method arguments.

Example:

# bad

def some_method(used, unused, _unused_but_allowed)
  puts used
end

Example:

# good

def some_method(used, _unused, _unused_but_allowed)
  puts used
end

There are no issues that match your filters.

Category
Status