Showing 270 of 283 total issues
Line is too long. [90/80] Open
Open
# * <tt>:params</tt> - url_for parameters for the links (:controller, :action, etc.)
- Exclude checks
Freeze mutable objects assigned to constants. Open
Open
VERSION = '1.2.2'
- Read upRead up
- Exclude checks
This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).
Example:
# bad
CONST = [1, 2, 3]
# good
CONST = [1, 2, 3].freeze
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem concurrent-ruby
should appear before rake
. Open
Open
gem 'concurrent-ruby', RUBY_VERSION < '2.2' ? '< 1.1.10' : RUBY_VERSION < '2.3' ? '< 1.2' : '>= 1.2'
- Read upRead up
- Exclude checks
Gems should be alphabetically sorted within groups.
Example:
# bad
gem 'rubocop'
gem 'rspec'
# good
gem 'rspec'
gem 'rubocop'
# good
gem 'rubocop'
gem 'rspec'
# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
source "https://rubygems.org"
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Line is too long. [81/80] Open
Open
"#{request.base_url}#{prev_page_path(scope, options)}" if scope.prev_page
- Exclude checks
Gem railties
requirements already given on line 9 of the Gemfile. Open
Open
gem 'railties', git: 'https://github.com/rails/rails.git', branch: '5-2-stable'
- Read upRead up
- Exclude checks
A Gem's requirements should be listed only once in a Gemfile.
Example:
# bad
gem 'rubocop'
gem 'rubocop'
# bad
group :development do
gem 'rubocop'
end
group :test do
gem 'rubocop'
end
# good
group :development, :test do
gem 'rubocop'
end
# good
gem 'rubocop', groups: [:development, :test]
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem activerecord
should appear before railties
. Open
Open
gem 'activerecord', git: 'https://github.com/rails/rails.git', require: 'active_record', branch: '5-2-stable'
- Read upRead up
- Exclude checks
Gems should be alphabetically sorted within groups.
Example:
# bad
gem 'rubocop'
gem 'rspec'
# good
gem 'rspec'
gem 'rubocop'
# good
gem 'rubocop'
gem 'rspec'
# good only if TreatCommentsAsGroupSeparators is true
# For code quality
gem 'rubocop'
# For tests
gem 'rspec'
Line is too long. [85/80] Open
Open
gem 'actionview', git: 'https://github.com/rails/rails.git', require: 'action_view'
- Exclude checks
Ternary operators must not be nested. Prefer if
or else
constructs instead. Open
Open
gem 'concurrent-ruby', RUBY_VERSION < '2.2' ? '< 1.1.10' : RUBY_VERSION < '2.3' ? '< 1.2' : '>= 1.2'
- Exclude checks