lujanfernaud/prevy

View on GitHub
app/services/name_formatter.rb

Summary

Maintainability
A
0 mins
Test Coverage

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

      @input = input.gsub(SEPARATORS, " ").gsub(EMAIL_PART, "")
Severity: Minor
Found in app/services/name_formatter.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"

Extra empty line detected at class body end.
Open


end
Severity: Minor
Found in app/services/name_formatter.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

Inconsistent indentation detected.
Open

    attr_reader :input
Severity: Minor
Found in app/services/name_formatter.rb by rubocop

This cops checks for inconsistent indentation.

Example:

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

Inconsistent indentation detected.
Open

    def remove_email_from_input
      @input = input.gsub(SEPARATORS, " ").gsub(EMAIL_PART, "")
    end
Severity: Minor
Found in app/services/name_formatter.rb by rubocop

This cops checks for inconsistent indentation.

Example:

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

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

      @input = input.gsub(SEPARATORS, " ").gsub(EMAIL_PART, "")
Severity: Minor
Found in app/services/name_formatter.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 sanitized_input
      input.strip.titleize
    end
Severity: Minor
Found in app/services/name_formatter.rb by rubocop

This cops checks for inconsistent indentation.

Example:

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

Extra empty line detected at class body beginning.
Open


  EMAIL_PART = /@.*/
Severity: Minor
Found in app/services/name_formatter.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

Inconsistent indentation detected.
Open

    def input_looks_like_a_name?
      input.match(/.*\s.*/) && !input.match(/@.*/)
    end
Severity: Minor
Found in app/services/name_formatter.rb by rubocop

This cops checks for inconsistent indentation.

Example:

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

There are no issues that match your filters.

Category
Status