Showing 829 of 829 total issues
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
%w[asc desc].include?(params[:sort]) ? params[:sort] : "asc"
- 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"
Use alias
instead of alias_method
in a class body. Open
alias_method :twitter, :all
- Read upRead up
- Exclude checks
This cop enforces the use of either #alias
or #alias_method
depending on configuration.
It also flags uses of alias :symbol
rather than alias bareword
.
Example: EnforcedStyle: prefer_alias (default)
# bad
alias_method :bar, :foo
alias :bar :foo
# good
alias bar foo
Example: EnforcedStyle: preferaliasmethod
# bad
alias :bar :foo
alias bar foo
# good
alias_method :bar, :foo
Prefer single quoted strings Open
@import "bootstrap/navbar";
- Exclude checks
0px
should be written without units as 0
Open
margin: 0px;
- Exclude checks
Align the parameters of a method call if they span more than one line. Open
notice: 'You can compare at most 3 listings. Please remove a listing from compare list'
- Read upRead up
- Exclude checks
Here we check if the parameters on a multi-line method call or definition are aligned.
Example: EnforcedStyle: withfirstparameter (default)
# good
foo :bar,
:baz
# bad
foo :bar,
:baz
Example: EnforcedStyle: withfixedindentation
# good
foo :bar,
:baz
# bad
foo :bar,
:baz
Use alias
instead of alias_method
in a class body. Open
alias_method :facebook, :all
- Read upRead up
- Exclude checks
This cop enforces the use of either #alias
or #alias_method
depending on configuration.
It also flags uses of alias :symbol
rather than alias bareword
.
Example: EnforcedStyle: prefer_alias (default)
# bad
alias_method :bar, :foo
alias :bar :foo
# good
alias bar foo
Example: EnforcedStyle: preferaliasmethod
# bad
alias :bar :foo
alias bar foo
# good
alias_method :bar, :foo
Extra empty line detected at class body beginning. Open
def create
- Read upRead up
- Exclude checks
This cops checks if empty lines around the bodies of classes match the configuration.
Example: EnforcedStyle: empty_lines
# good
class Foo
def bar
# ...
end
end
Example: EnforcedStyle: emptylinesexcept_namespace
# good
class Foo
class Bar
# ...
end
end
Example: EnforcedStyle: emptylinesspecial
# good
class Foo
def bar; end
end
Example: EnforcedStyle: noemptylines (default)
# good
class Foo
def bar
# ...
end
end
Color literals like rgb(223, 223, 223)
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
border-bottom: 1px solid rgb(223, 223, 223);
- Exclude checks
Prefer single quoted strings Open
@import "bootstrap/carousel";
- Exclude checks
0px
should be written without units as 0
Open
padding: 40px 0px;
- Exclude checks
Space missing to the left of {. Open
@properties = session[:compare_list].map{|id| Property.find_by_id(id) }
- Read upRead up
- Exclude checks
Checks that block braces have or don't have a space before the opening brace depending on configuration.
Example:
# bad
foo.map{ |a|
a.bar.to_s
}
# good
foo.map { |a|
a.bar.to_s
}
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
user = User.from_omniauth(request.env["omniauth.auth"])
- 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 Open
@import "globals/placeholders";
- Exclude checks
Rule declaration should be followed by an empty line Open
}
- Exclude checks
Line is too long. [81/80] Open
# Avoid using model.id or version_name here, see uploader/store.rb for details.
- Exclude checks
Color literals like rgb(92, 92, 92)
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
background: none repeat scroll 0% 0% rgb(92, 92, 92);
- Exclude checks
Properties should be ordered margin-top, padding, width Open
padding: 10px;
- Exclude checks
Properties should be ordered font-size, position, right, top Open
position: absolute;
- Exclude checks
Put empty method definitions on a single line. Open
def info
end
- Read upRead up
- Exclude checks
This cop checks for the formatting of empty method definitions.
By default it enforces empty method definitions to go on a single
line (compact style), but it can be configured to enforce the end
to go on its own line (expanded style).
Note: A method definition is not considered empty if it contains comments.
Example: EnforcedStyle: compact (default)
# bad
def foo(bar)
end
def self.foo(bar)
end
# good
def foo(bar); end
def foo(bar)
# baz
end
def self.foo(bar); end
Example: EnforcedStyle: expanded
# bad
def foo(bar); end
def self.foo(bar); end
# good
def foo(bar)
end
def self.foo(bar)
end
0px
should be written without units as 0
Open
@include box-shadow(0px 1px 3px rgba(42, 43, 43, 0.1));
- Exclude checks