Showing 114 of 114 total issues
Line is too long. [115/80] Open
Open
raise "#{key}=#{raw}, using percentage in invalid field, valid=#{Definition::TRANSLATIONS.keys.join(', ')}"
- Exclude checks
Use tr
instead of gsub
. Open
Open
name = key.downcase.gsub(/-/, '_')
- Read upRead up
- Exclude checks
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(' ')
Use Range#cover?
instead of Range#include?
. Open
Open
return if (0...monitor_height).include? y_pos
- Read upRead up
- Exclude checks
This cop identifies uses of Range#include?
, which iterates over each
item in a Range
to see if a specified item is there. In contrast,
Range#cover?
simply compares the target item with the beginning and
end points of the Range
. In a great majority of cases, this is what
is wanted.
Here is an example of a case where Range#cover?
may not provide the
desired result:
('a'..'z').cover?('yellow') # => true
Line is too long. [91/80] Open
Open
raise Error, "Invalid configuration file: #{e.message}, line=#{line}, file=#{file}"
- Exclude checks
Line is too long. [87/80] Open
Open
Process.spawn(cmd, out: [out, 'a'], err: [err, 'a'], pgroup: Process.getpgrp)
- Exclude checks
Line is too long. [101/80] Open
Open
new_window = detect_new_windows.find { |window| window_for?(waiter, program, title, window) }
- Exclude checks
Line is too long. [111/80] Open
Open
raise Error, "Trying to write empty configuration on existing file #{conf_file}" if File.exist? conf_file
- Exclude checks
Line is too long. [112/80] Open
Open
def initialize(configuration_loader: ConfigurationLoader.new, definition_processor: DefinitionProcessor.new)
- Exclude checks
Line is too long. [119/80] Open
Open
opts.on('-w', '--wait-time NUMBER_OF_SECONDS (1-120), default=30', 'Wait time for detecting a window') do |value|
- Exclude checks
Line is too long. [116/80] Open
Open
log.debug "Found new window: pid=#{window.pid}, ppid=#{window_pgroup}, id=#{window.id}, title=#{window.title}"
- Exclude checks
Line is too long. [120/80] Open
Open
raise Error, "#{key} percentage is invalid=#{raw}, valid=5%-100%" if percentage < min_percentage || percentage > 1
- Exclude checks
TODO found Open
Open
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
- Exclude checks
TODO found Open
Open
# spec.description = %q{TODO: Write a longer description or delete this line.}
- Exclude checks
TODO found Open
Open
# spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
- Exclude checks