Showing 829 of 829 total issues
Don't use parentheses around a method call. Open
Open
session[:compare_list].delete((params[:id]).to_i) unless session[:compare_list].nil?
- Read upRead up
- Exclude checks
This cop checks for redundant parentheses.
Example:
# bad
(x) if ((y.z).nil?)
# good
x if y.z.nil?
%w
-literals should be delimited by [
and ]
. Open
Open
%w(jpg jpeg gif png)
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Properties should be ordered color, margin-bottom Open
Open
margin-bottom: 10px;
- Exclude checks
0px
should be written without units as 0
Open
Open
left: 0px;
- Exclude checks
Use ==
if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition. Open
Open
next unless check_value = options[key]
- Read upRead up
- Exclude checks
This cop checks for assignments in the conditions of if/while/until.
Example:
# bad
if some_var = true
do_something
end
Example:
# good
if some_var == true
do_something
end
Rule declaration should be followed by an empty line Open
Open
}
- Exclude checks
Use //
comments everywhere Open
Open
/*font-size: 120%;*/
- Exclude checks
Line is too long. [91/80] Open
Open
RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :tokenizer, :too_short, :too_long]
- Exclude checks
Shorthand form for property margin
should be written more concisely as 10px auto 30px
instead of 10px auto 30px auto
Open
Open
margin: 10px auto 30px auto;
- Exclude checks
Avoid vendor prefixes. Open
Open
-webkit-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
- Exclude checks
Use %i
or %I
for an array of symbols. Open
Open
gem 'rspec-rails', '~> 2.13.2', group: [:development, :test]
- Read upRead up
- Exclude checks
This cop can check for array literals made up of symbols that are not using the %i() syntax.
Alternatively, it checks for symbol arrays using the %i() syntax on projects which do not want to use that syntax.
Configuration option: MinSize
If set, arrays with fewer elements than this value will not trigger the
cop. For example, a MinSize of
3` will not enforce a style on an array
of 2 or fewer elements.
Example: EnforcedStyle: percent (default)
# good
%i[foo bar baz]
# bad
[:foo, :bar, :baz]
Example: EnforcedStyle: brackets
# good
[:foo, :bar, :baz]
# bad
%i[foo bar baz]
Selector debug_dump
should be written in lowercase with hyphens Open
Open
.debug_dump {
- Exclude checks
Properties should be ordered border-bottom, border-top, padding Open
Open
border-top: 1px solid rgb(255, 255, 255);
- Exclude checks
Color literals like rgba(0, 0, 0, 0.18)
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
Open
border-bottom: 1px solid rgba(0, 0, 0, 0.18);
- Exclude checks
0.18
should be written without a leading zero as .18
Open
Open
border-bottom: 1px solid rgba(0, 0, 0, 0.18);
- Exclude checks
0px
should be written without units as 0
Open
Open
margin: 11px 20px 0px 0px;
- Exclude checks
Use //
comments everywhere Open
Open
/*** Variables ***/
- Exclude checks
Prefer single quoted strings Open
Open
@import "bootstrap/scaffolding";
- Exclude checks
Prefer single quoted strings Open
Open
@import "bootstrap/code";
- Exclude checks
Each selector in a comma sequence should be on its own single line Open
Open
.collapsed .caret-category, .caret-category.closed {
- Exclude checks