Method has too many lines. [25/15] Open
def fastday_generate
memoes = []
MAP.each do |scheme|
event = Event.where(memory_id: Slug.where(text: scheme.slug).first.sluggable.id,
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for fastday_generate is too high. [31.4/30] Open
def fastday_generate
memoes = []
MAP.each do |scheme|
event = Event.where(memory_id: Slug.where(text: scheme.slug).first.sluggable.id,
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
slug: "спас",
- 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"
Duplicated key in hash literal. Open
('01.08'..'14.08') => {
- Read upRead up
- Exclude checks
This cop checks for duplicated keys in hash literals.
This cop mirrors a warning in Ruby 2.2.
Example:
# bad
hash = { food: 'apple', food: 'orange' }
Example:
# good
hash = { food: 'apple', other_food: 'orange' }
Duplicated key in hash literal. Open
('01.08'..'14.08') => {
- Read upRead up
- Exclude checks
This cop checks for duplicated keys in hash literals.
This cop mirrors a warning in Ruby 2.2.
Example:
# bad
hash = { food: 'apple', food: 'orange' }
Example:
# good
hash = { food: 'apple', other_food: 'orange' }
Missing top-level class documentation comment. Open
class MemoService
- 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
Freeze mutable objects assigned to constants. Open
MAP = {
slug: "спас",
event_kind_code: "Betraial",
order: "Спаситель",
ranges: {
- 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
Useless assignment to variable - week
. Open
week = indent / 7 + 1
- Read upRead up
- Exclude checks
This cop checks for every useless assignment to local variable in every
scope.
The basic idea for this cop was from the warning of ruby -cw
:
assigned but unused variable - foo
Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.
Example:
# bad
def some_method
some_var = 1
do_something
end
Example:
# good
def some_method
some_var = 1
do_something(some_var)
end
Trailing whitespace detected. Open
#4.04/22.03
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
event_kind_code: "Betraial",
- 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"
The use of eval
is a serious security risk. Open
text = eval(text_in)
- Read upRead up
- Exclude checks
This cop checks for the use of Kernel#eval
and Binding#eval
.
Example:
# bad
eval(something)
binding.eval(something)
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
order: "Спаситель",
- 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"
Interpolation in single quoted string detected. Use double quoted strings if you need interpolation. Open
ру_РУ: "Пятница \#{week}-я по Пасхе"
- Read upRead up
- Exclude checks
This cop checks for interpolation in a single quoted string.
Example:
# bad
foo = 'something with #{interpolation} inside'
Example:
# good
foo = "something with #{interpolation} inside"
Duplicated key in hash literal. Open
('01.08'..'14.08') => {
- Read upRead up
- Exclude checks
This cop checks for duplicated keys in hash literals.
This cop mirrors a warning in Ruby 2.2.
Example:
# bad
hash = { food: 'apple', food: 'orange' }
Example:
# good
hash = { food: 'apple', other_food: 'orange' }
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
def initialize calendary, add_date = Time.now.strptime("%d.%m.%Y %H:%M")
- 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"
Interpolation in single quoted string detected. Use double quoted strings if you need interpolation. Open
ру_РУ: "Среда \#{week}-я по Пасхе"
- Read upRead up
- Exclude checks
This cop checks for interpolation in a single quoted string.
Example:
# bad
foo = 'something with #{interpolation} inside'
Example:
# good
foo = "something with #{interpolation} inside"
Interpolation in single quoted string detected. Use double quoted strings if you need interpolation. Open
ру_РУ: "\#{weekday} \{week}-я Петрова поста"
- Read upRead up
- Exclude checks
This cop checks for interpolation in a single quoted string.
Example:
# bad
foo = 'something with #{interpolation} inside'
Example:
# good
foo = "something with #{interpolation} inside"
Interpolation in single quoted string detected. Use double quoted strings if you need interpolation. Open
ру_РУ: "\#{weekday} \{week}-я Великого поста"
- Read upRead up
- Exclude checks
This cop checks for interpolation in a single quoted string.
Example:
# bad
foo = 'something with #{interpolation} inside'
Example:
# good
foo = "something with #{interpolation} inside"
Missing space after #
. Open
#4.04/22.03
- Read upRead up
- Exclude checks
This cop checks whether comments have a leading space after the
#
denoting the start of the comment. The leading space is not
required for some RDoc special syntax, like #++
, #--
,
#:nodoc
, =begin
- and =end
comments, "shebang" directives,
or rackup options.
Example:
# bad
#Some comment
# good
# Some comment
Remove debugger entry point binding.pry
. Open
binding.pry
- Read upRead up
- Exclude checks
This cop checks for calls to debugger or pry.
Example:
# bad (ok during development)
# using pry
def some_method
binding.pry
do_something
end
Example:
# bad (ok during development)
# using byebug
def some_method
byebug
do_something
end
Example:
# good
def some_method
do_something
end