call4paperz/call4paperz

View on GitHub
app/models/profile.rb

Summary

Maintainability
A
0 mins
Test Coverage

Place the . on the next line, together with the method name.
Open

    auth = authentications.
Severity: Minor
Found in app/models/profile.rb by rubocop

This cop checks the . position in multi-line method calls.

Example: EnforcedStyle: leading (default)

# bad
something.
  method

# good
something
  .method

Example: EnforcedStyle: trailing

# bad
something
  .method

# good
something.
  method

Line is too long. [82/80]
Open

  def_delegators :@user, :authentications, :comments, :events, :proposals, :votes,
Severity: Minor
Found in app/models/profile.rb by rubocop

Use alias instead of alias_method in a class body.
Open

  alias_method :eql?, :==
Severity: Minor
Found in app/models/profile.rb by rubocop

This cop enforces the use of either #alias or #alias_method depending on configuration. It also flags uses of alias :symbol rather than alias bareword.

Example: EnforcedStyle: prefer_alias (default)

# bad
alias_method :bar, :foo
alias :bar :foo

# good
alias bar foo

Example: EnforcedStyle: preferaliasmethod

# bad
alias :bar :foo
alias bar foo

# good
alias_method :bar, :foo

Missing magic comment # frozen_string_literal: true.
Open

# Aggregates the user data. It is an entry point to reach all the data directly
Severity: Minor
Found in app/models/profile.rb by rubocop

This cop is designed to help upgrade to after Ruby 3.0. It will add the comment # frozen_string_literal: true to the top of files to enable frozen string literals. Frozen string literals may be default after Ruby 3.0. The comment will be added below a shebang and encoding comment. The frozen string literal comment is only valid in Ruby 2.3+.

Example: EnforcedStyle: always (default)

# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
  # ...
end

# good
# frozen_string_literal: true

module Bar
  # ...
end

Example: EnforcedStyle: never

# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true

module Baz
  # ...
end

# good
module Baz
  # ...
end

Align where with authentications. on line 32.
Open

      where(provider: authentication.provider, uid: authentication.uid).first
Severity: Minor
Found in app/models/profile.rb by rubocop

This cop checks the indentation of the method name part in method calls that span more than one line.

Example: EnforcedStyle: aligned (default)

# bad
while myvariable
.b
  # do something
end

# good
while myvariable
      .b
  # do something
end

# good
Thing.a
     .b
     .c

Example: EnforcedStyle: indented

# good
while myvariable
  .b

  # do something
end

Example: EnforcedStyle: indentedrelativeto_receiver

# good
while myvariable
        .a
        .b

  # do something
end

# good
myvariable = Thing
               .a
               .b
               .c

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

    unless auth
Severity: Minor
Found in app/models/profile.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. The tab size is configured in the IndentationWidth of the Layout/Tab 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?

Missing top-level class documentation comment.
Open

class Profile
Severity: Minor
Found in app/models/profile.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Use a guard clause (return if auth) instead of wrapping the code inside a conditional expression.
Open

    unless auth
Severity: Minor
Found in app/models/profile.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

When defining the == operator, name its argument other.
Open

  def ==(profile)
Severity: Minor
Found in app/models/profile.rb by rubocop

This cop makes sure that certain binary operator methods have their sole parameter named other.

Example:

# bad
def +(amount); end

# good
def +(other); end

There are no issues that match your filters.

Category
Status