firehoseio/firehose

View on GitHub
lib/firehose/rack.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Use tr instead of gsub.
Open

    RACK_LAST_MESSAGE_SEQUENCE_HEADER = "HTTP_#{LAST_MESSAGE_SEQUENCE_HEADER.upcase.gsub('-', '_')}"
Severity: Minor
Found in lib/firehose/rack.rb by rubocop

This cop identifies places where gsub can be replaced by tr or delete.

Example:

# bad
'abc'.gsub('b', 'd')
'abc'.gsub('a', '')
'abc'.gsub(/a/, 'd')
'abc'.gsub!('a', 'd')

# good
'abc'.gsub(/.*/, 'a')
'abc'.gsub(/a+/, 'd')
'abc'.tr('b', 'd')
'a b c'.delete(' ')

There are no issues that match your filters.

Category
Status