ManageIQ/manageiq-appliance_console

View on GitHub
lib/manageiq/appliance_console/i18n.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Remove redundant sort.
Open

locales_paths.each { |p| I18n.load_path += Dir[p].sort }

Sort globbed results by default in Ruby 3.0. This cop checks for redundant sort method to Dir.glob and Dir[].

Safety:

This cop is unsafe, in case of having a file and a directory with identical names, since directory will be loaded before the file, which will break exe/files.rb that rely on exe.rb file.

Example:

# bad
Dir.glob('./lib/**/*.rb').sort.each do |file|
end

Dir['./lib/**/*.rb'].sort.each do |file|
end

# good
Dir.glob('./lib/**/*.rb').each do |file|
end

Dir['./lib/**/*.rb'].each do |file|
end

There are no issues that match your filters.

Category
Status