dominicsayers/name_tamer

View on GitHub
lib/name_tamer/string.rb

Summary

Maintainability
C
1 day
Test Coverage

File string.rb has 481 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class String
  unless respond_to? :presence
    def presence
      self unless empty?
    end
Severity: Minor
Found in lib/name_tamer/string.rb - About 7 hrs to fix

Class String has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

class String
  unless respond_to? :presence
    def presence
      self unless empty?
    end
Severity: Minor
Found in lib/name_tamer/string.rb - About 3 hrs to fix

Avoid comma after the last item of an array. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
Open

    'Service Company',
Severity: Minor
Found in lib/name_tamer/string.rb by rubocop

This cop checks for trailing comma in array and hash literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

Freeze mutable objects assigned to constants.
Open

  NONBREAKING_SPACE = "\u00a0"
Severity: Minor
Found in lib/name_tamer/string.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Freeze mutable objects assigned to constants.
Open

  ASCII_SPACE = ' '
Severity: Minor
Found in lib/name_tamer/string.rb by rubocop

This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

Example:

# bad
CONST = [1, 2, 3]

# good
CONST = [1, 2, 3].freeze

Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
Open

    'Ž' => 'Z',
Severity: Minor
Found in lib/name_tamer/string.rb by rubocop

This cop checks for trailing comma in array and hash literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

Avoid comma after the last item of an array. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
Open

    'Zur',
Severity: Minor
Found in lib/name_tamer/string.rb by rubocop

This cop checks for trailing comma in array and hash literals.

Example: EnforcedStyleForMultiline: consistent_comma

# bad
a = [1, 2,]

# good
a = [
  1, 2,
  3,
]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: comma

# bad
a = [1, 2,]

# good
a = [
  1,
  2,
]

Example: EnforcedStyleForMultiline: no_comma (default)

# bad
a = [1, 2,]

# good
a = [
  1,
  2
]

There are no issues that match your filters.

Category
Status