Showing 1,937 of 1,937 total issues
Avoid rescuing the Exception
class. Perhaps you meant to rescue StandardError
? Open
Open
rescue Exception # rescues StandardError by default; but we want to rescue and report all errors
raise if raise_exceptions?
$!.additional_information[:event] = event
$!.additional_information[:async] = invoke_async?
- Read upRead up
- Exclude checks
This cop checks for rescue blocks targeting the Exception class.
Example:
# bad
begin
do_something
rescue Exception
handle_exception
end
Example:
# good
begin
do_something
rescue ArgumentError
handle_exception
end
Prefer $ERROR_INFO
from the stdlib 'English' module (don't forget to require it) over $!
. Open
Open
$!.additional_information[:async] = invoke_async?
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
arguments = t.name.split(":")[1..-1] # skip test:
- 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"
Line exceeds maximum allowed length Open
Open
'<div class="timeline-date-gap"></div>' + Handlebars.helpers.timelineDate(date)
- Exclude checks
Line exceeds maximum allowed length Open
Open
# single argument t and returns a number between the starting angle and the
- Exclude checks
Prefer $ERROR_INFO
from the stdlib 'English' module (don't forget to require it) over $!
. Open
Open
Houston.report_exception($!)
- Exclude checks
Trailing whitespace detected. Open
Open
#
- Exclude checks
Trailing whitespace detected. Open
Open
#
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
gem "webmock", require: "webmock/minitest"
- 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 when you don't need string interpolation or special symbols. Open
Open
gem "minitest-reporters-turn_reporter", require: false
- 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"
Line exceeds maximum allowed length Open
Open
return unless @$window.scrollTop() >= (@$document.height() - @$window.height() - @offset)
- Exclude checks
Line exceeds maximum allowed length Open
Open
relativeRoot = relativeRoot.substring(0, relativeRoot.length - 1) if /\/$/.test(relativeRoot)
- Exclude checks
Line exceeds maximum allowed length Open
Open
"<img src=\"#{gravatarUrl}\" class=\"avatar\" width=\"#{size}\" height=\"#{size}\" rel=\"tooltip\" title=\"#{title}\" />"
- Exclude checks
Line exceeds maximum allowed length Open
Open
# Double the length because Opera is inconsistent about whether a carriage return is one character or two. Sigh.
- Exclude checks
Line exceeds maximum allowed length Open
Open
# center of the canvas. This way, we don't need to position arcs individually.
- Exclude checks
Surrounding space missing in default value assignment. Open
Open
def fire(event, params={})
- Read upRead up
- Exclude checks
Checks that the equals signs in parameter default assignments have or don't have surrounding space depending on configuration.
Example:
# bad
def some_method(arg1=:default, arg2=nil, arg3=[])
# do something...
end
# good
def some_method(arg1 = :default, arg2 = nil, arg3 = [])
# do something...
end
Line is too long. [85/80] Open
Open
raise ArgumentError, "params must be a Hash" unless params.respond_to?(:to_h)
- Exclude checks
Extra empty line detected at class body end. Open
Open
end
- 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
Line is too long. [139/80] Open
Open
raise UnregisteredParamError, "#{unregistered_params.first.inspect} is a not a registered param of the event #{event_name.inspect}"
- Exclude checks
Extra blank line detected. Open
Open
- Read upRead up
- Exclude checks
This cops checks for two or more consecutive blank lines.
Example:
# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method
# good
some_method
# one empty line
some_method