elitmus/omniauth-elitmus

View on GitHub

Showing 126 of 126 total issues

OmniAuth::Strategies::Elitmus has missing safe method 'prune!'
Open

            def prune!(hash)
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by reek

A candidate method for the Missing Safe Method smell are methods whose names end with an exclamation mark.

An exclamation mark in method names means (the explanation below is taken from here ):

The ! in method names that end with ! means, “This method is dangerous”—or, more precisely, this method is the “dangerous” version of an otherwise equivalent method, with the same name minus the !. “Danger” is relative; the ! doesn’t mean anything at all unless the method name it’s in corresponds to a similar but bang-less method name. So, for example, gsub! is the dangerous version of gsub. exit! is the dangerous version of exit. flatten! is the dangerous version of flatten. And so forth.

Such a method is called Missing Safe Method if and only if her non-bang version does not exist and this method is reported as a smell.

Example

Given

class C
  def foo; end
  def foo!; end
  def bar!; end
end

Reek would report bar! as Missing Safe Method smell but not foo!.

Reek reports this smell only in a class context, not in a module context in order to allow perfectly legit code like this:

class Parent
  def foo; end
end

module Dangerous
  def foo!; end
end

class Son < Parent
  include Dangerous
end

class Daughter < Parent
end

In this example, Reek would not report the Missing Safe Method smell for the method foo of the Dangerous module.

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

require "bundler/gem_tasks"
Severity: Minor
Found in Rakefile 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"

Extra empty line detected at block body beginning.
Open


                    # Reek has a problem with the below code. Trying to rewrite the same
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

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

Example: EnforcedStyle: empty_lines

# good

foo do |bar|

  # ...

end

Example: EnforcedStyle: noemptylines (default)

# good

foo do |bar|
  # ...
end

Use 2 (not -5) spaces for indentation.
Open

                    prune!(value) if value.is_a?(Hash)
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

This cops checks for indentation that doesn't use the specified number of spaces.

See also the IndentationConsistency cop which is the companion to this one.

Example:

# bad
class A
 def test
  puts 'hello'
 end
end

# good
class A
  def test
    puts 'hello'
  end
end

Example: IgnoredPatterns: ['^\s*module']

# bad
module A
class B
  def test
  puts 'hello'
  end
end
end

# good
module A
class B
  def test
    puts 'hello'
  end
end
end

Tab detected.
Open

            DEFAULT_SCOPE = 'public'
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

                    'name' => raw_info['name']
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

                    #  in a different way to make reek happy
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

                    if params_hash.has_key?['scope']
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

                    else
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

                    params[:auth_type] = params_hash['auth_type']  if params_hash.has_key?['auth_type']
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Redundant curly braces around a hash parameter.
Open

                prune!({
                    'email' => raw_info['email'],
                    'name' => raw_info['name']
                 })
Severity: Minor
Found in lib/omniauth/strategies/elitmus.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})

Use %i or %I for an array of symbols.
Open

            option :authorize_options, [:scope, :auth_type]
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

This cop can check for array literals made up of symbols that are not using the %i() syntax.

Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.

Configuration option: MinSize If set, arrays with fewer elements than this value will not trigger the cop. For example, a MinSize of3` will not enforce a style on an array of 2 or fewer elements.

Example: EnforcedStyle: percent (default)

# good
%i[foo bar baz]

# bad
[:foo, :bar, :baz]

Example: EnforcedStyle: brackets

# good
[:foo, :bar, :baz]

# bad
%i[foo bar baz]

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

    VERSION = "0.0.4"
Severity: Minor
Found in lib/omniauth/elitmus/version.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"

Tab detected.
Open

    module Strategies
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

1 trailing blank lines detected.
Open

Severity: Minor
Found in Rakefile by rubocop

Tab detected.
Open

            }
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

                    #         if request.params[val]
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

            option :name, :elitmus
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

                    # params[:scope] ||= DEFAULT_SCOPE
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop

Tab detected.
Open

            def prune!(hash)
Severity: Minor
Found in lib/omniauth/strategies/elitmus.rb by rubocop
Severity
Category
Status
Source
Language