Showing 208 of 208 total issues
Unqualified attribute selectors are known to be slow. Open
.owl-theme .owl-controls .owl-nav [class*=owl-]:hover{
- Exclude checks
Use of !important Open
padding-right: 0 !important;
- Exclude checks
Unqualified attribute selectors are known to be slow. Open
.owl-theme .owl-controls .owl-nav [class*=owl-]{
- Exclude checks
Expected (<font-style>) but found 'none'.</font-style> Open
font-style: none;
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.btn-colorselector {
- Exclude checks
Use of !important Open
padding-left: 0 !important;
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.ms-container ul{
- Exclude checks
Values of 0 shouldn't have units specified. Open
margin-top: 0px;
- Exclude checks
Don't use IDs in selectors. Open
#wsp-event-show-banner {
- Exclude checks
Using width with padding can sometimes make elements larger than you expect. Open
padding: 7px;
- Exclude checks
Avoid comparing a variable with multiple items in a conditional, use Array#include?
instead. Open
order_by = 'asc' unless order_by == 'asc' || order_by == 'desc'
- Read upRead up
- Exclude checks
This cop checks against comparing a variable with multiple items, where
Array#include?
could be used instead to avoid code repetition.
Example:
# bad
a = 'a'
foo if a == 'a' || a == 'b' || a == 'c'
# good
a = 'a'
foo if ['a', 'b', 'c'].include?(a)
Favor modifier unless
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
unless File.exist?(file_full_path)
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if after_deadline?
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
%i
-literals should be delimited by [
and ]
. Open
Profile.allowed_params + %i(address name age)
- 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)
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if current_user.role == 'admin' || current_user.role == 'organizer'
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Favor modifier unless
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
unless params.key?(:selected_participants)
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Standard property 'transform' should come after vendor-prefixed property '-moz-transform'. Open
-moz-transform: rotate(5deg);
- Exclude checks
Standard property 'transform' should come after vendor-prefixed property '-ms-transform'. Open
-ms-transform: rotate(5deg);
- Exclude checks
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if params[:search]
- Read upRead up
- Exclude checks
Checks for if and unless statements that would fit on one line
if written as a modifier if/unless. The maximum line length is
configured in the Metrics/LineLength
cop.
Example:
# bad
if condition
do_stuff(bar)
end
unless qux.empty?
Foo.do_something
end
# good
do_stuff(bar) if condition
Foo.do_something unless qux.empty?
Use %i
or %I
for an array of symbols. Open
date_ranges_attributes: [:start_date, :end_date, :id]
- 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]