lib/anodator/message.rb
Method has too many lines. [13/10] Open
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'
- Read upRead up
- Exclude checks
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
Open
# Message#expand method is expand keywords by data_provider suppried by parameter.
- Exclude checks
Line is too long. [99/80] Open
Open
raise UnknownMessageAttributeError, "Unknown message attribute '#{Regexp.last_match(2)}'"
- Exclude checks
Line is too long. [99/80] Open
Open
raise UnknownMessageAttributeError, "Unknown message attribute '#{Regexp.last_match(2)}'"
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression. Open
Open
if @template.split(//).size.zero?
- Read upRead up
- Exclude checks
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