Showing 829 of 829 total issues
Space inside string interpolation detected. Open
notice: "You favorited #{ @property.category } at #{ @property.street }"
- Read upRead up
- Exclude checks
This cop checks for whitespace within string interpolations.
Example: EnforcedStyle: no_space (default)
# bad
var = "This is the #{ space } example"
# good
var = "This is the #{no_space} example"
Example: EnforcedStyle: space
# bad
var = "This is the #{no_space} example"
# good
var = "This is the #{ space } example"
end
at 43, 17 is not aligned with if
at 39, 15. Open
end
- Read upRead up
- Exclude checks
This cop checks whether the end keywords are aligned properly.
Three modes are supported through the EnforcedStyleAlignWith
configuration parameter:
If it's set to keyword
(which is the default), the end
shall be aligned with the start of the keyword (if, class, etc.).
If it's set to variable
the end
shall be aligned with the
left-hand-side of the variable assignment, if there is one.
If it's set to start_of_line
, the end
shall be aligned with the
start of the line where the matching keyword appears.
Example: EnforcedStyleAlignWith: keyword (default)
# bad
variable = if true
end
# good
variable = if true
end
Example: EnforcedStyleAlignWith: variable
# bad
variable = if true
end
# good
variable = if true
end
Example: EnforcedStyleAlignWith: startofline
# bad
variable = if true
end
# good
puts(if true
end)
Prefer Object#is_a?
over Object#kind_of?
. Open
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
- Read upRead up
- Exclude checks
This cop enforces consistent use of Object#is_a?
or Object#kind_of?
.
Example: EnforcedStyle: is_a? (default)
# bad
var.kind_of?(Date)
var.kind_of?(Integer)
# good
var.is_a?(Date)
var.is_a?(Integer)
Example: EnforcedStyle: kind_of?
# bad
var.is_a?(Time)
var.is_a?(String)
# good
var.kind_of?(Time)
var.kind_of?(String)
Color literals like rgb(112, 116, 124)
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
color: rgb(112, 116, 124);
- Exclude checks
Properties should be ordered float, margin-top Open
margin-top: 2px;
- Exclude checks
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem jquery-rails
should appear before simple_form
. Open
gem 'jquery-rails', '~> 3.0.1'
- 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'
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem pry-rails
should appear before rb-inotify
. Open
gem 'pry-rails', '~> 0.3.0'
- 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 Open
@import "compass";
- Exclude checks
Line is too long. [87/80] Open
@compares_quicklist = Property.includes(:images).find(session[:compare_list] || [])
- Exclude checks
0px
should be written without units as 0
Open
@include box-shadow(0px 1px 6px #bbb);
- Exclude checks
Shorthand form for property margin
should be written more concisely as 10px auto 30px
instead of 10px auto 30px auto
Open
margin: 10px auto 30px auto;
- Exclude checks
Use //
comments everywhere Open
/*padding-left: 50px;*/
- Exclude checks
Missing top-level class documentation comment. Open
class FileSizeValidator < ActiveModel::EachValidator
- Read upRead up
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
# good
# Description/Explanation of Person class
class Person
# ...
end
Color literals like #676767
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
color: #676767;
- Exclude checks
Properties should be ordered background-color, color, float, font-size, margin-bottom, opacity, padding, position, right, text-align, top Open
font-size: 1.1em;
- Exclude checks
Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem geocoder
should appear before mini_magick
. Open
gem 'geocoder', '~> 1.1.8'
- 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 Open
@import "bootstrap/wells";
- Exclude checks
Use //
comments everywhere Open
/*** Libraries ***/
- Exclude checks
Color literals like rgba(64, 64, 64, 0.5)
should only be used in variable declarations; they should be referred to via variable everywhere else. Open
-webkit-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
- Exclude checks
Prefer single quoted strings Open
@import "bootstrap/alerts"; // Note: alerts share common CSS with buttons and thus have styles in buttons
- Exclude checks