maki-tetsu/anodator

View on GitHub
lib/anodator/message.rb

Summary

Maintainability
A
0 mins
Test Coverage

Method has too many lines. [13/10]
Open

    def expand(data_provider)
      @template.gsub(/\[\[([^:]+)::([^\]]+)\]\]/) do
        spec_item = data_provider.spec_item_by_expression(Regexp.last_match(1))
        case Regexp.last_match(2)
        when 'name'
Severity: Minor
Found in lib/anodator/message.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Line is too long. [84/80]
Open

  # Message#expand method is expand keywords by data_provider suppried by parameter.
Severity: Minor
Found in lib/anodator/message.rb by rubocop

Line is too long. [99/80]
Open

          raise UnknownMessageAttributeError, "Unknown message attribute '#{Regexp.last_match(2)}'"
Severity: Minor
Found in lib/anodator/message.rb by rubocop

Line is too long. [99/80]
Open

          raise UnknownMessageAttributeError, "Unknown message attribute '#{Regexp.last_match(2)}'"
Severity: Minor
Found in lib/anodator/message.rb by rubocop

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

      if @template.split(//).size.zero?
Severity: Minor
Found in lib/anodator/message.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

There are no issues that match your filters.

Category
Status