Showing 1,441 of 1,441 total issues
Line is too long. [84/80] Open
key :description, I18n.t('api.annotation_document.description.interface_type')
- Exclude checks
Line is too long. [94/80] Open
return integer_and_action_label(token, predecessor_token) if is_integer_and_action?(token)
- Exclude checks
Align .find
with predecessor_token
on line 82. Open
.find(integer)
- Read upRead up
- Exclude checks
This cop checks the indentation of the method name part in method calls that span more than one line.
Example: EnforcedStyle: aligned
# bad
while myvariable
.b
# do something
end
# good
while myvariable
.b
# do something
end
# good
Thing.a
.b
.c
Example: EnforcedStyle: indented
# good
while myvariable
.b
# do something
end
Example: EnforcedStyle: indentedrelativeto_receiver
# good
while myvariable
.a
.b
# do something
end
# good
myvariable = Thing
.a
.b
.c
Rename is_integer_and_action?
to integer_and_action?
. Open
def is_integer_and_action?(integer_and_action)
- Read upRead up
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end
Line is too long. [84/80] Open
.gsub(/^http(|s):\/\/[^\/]+(|:[0-9]+)/, '') # remove protocol, domain and port
- Exclude checks
Rename is_action?
to action?
. Open
def is_action?(action)
- Read upRead up
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end
Keep a blank line before and after private
. Open
private
- Read upRead up
- Exclude checks
Access modifiers should be surrounded by blank lines.
Example:
# bad
class Foo
def bar; end
private
def baz; end
end
# good
class Foo
def bar; end
private
def baz; end
end
Avoid using rescue
in its modifier form. Open
model = predecessor_token
.singularize
.classify
.constantize
.find(integer)
- Read upRead up
- Exclude checks
This cop checks for uses of rescue in its modifier form.
Example:
# bad
some_method rescue handle_error
# good
begin
some_method
rescue
handle_error
end
Avoid using rescue
in its modifier form. Open
klass.classify.constantize rescue false
- Read upRead up
- Exclude checks
This cop checks for uses of rescue in its modifier form.
Example:
# bad
some_method rescue handle_error
# good
begin
some_method
rescue
handle_error
end
Line is too long. [88/80] Open
# Never trust parameters from the scary internet, only allow the white list through.
- Exclude checks
Inconsistent indentation detected. Open
def set_available_services
@available_services = {}
@roles.each do |role|
role_symbol = role.to_sym
@available_services[role_symbol] = Service.where(role: role_symbol)
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
def set_project
@project = current_role.projects.find(params[:project_id])
rescue
render_annotation_document_errors 400, 'set-project.not-found'
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
def project_params
params.require(:project).permit(
:iterate_service,
:data,
:description,
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
def redirect_iterate_with_flash
flash[:error] = I18n.t('projects.iterate.error')
redirect_to project_annotation_documents_path(@project)
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Line is too long. [81/80] Open
process_iteration_data_response_hash(raw_data)
- Exclude checks
Avoid rescuing without specifying an error class. Open
rescue
- Read upRead up
- Exclude checks
This cop checks for rescuing StandardError
. There are two supported
styles implicit
and explicit
. This cop will not register an offense
if any error other than StandardError
is specified.
Example: EnforcedStyle: implicit
# `implicit` will enforce using `rescue` instead of
# `rescue StandardError`.
# bad
begin
foo
rescue StandardError
bar
end
# good
begin
foo
rescue
bar
end
# good
begin
foo
rescue OtherError
bar
end
# good
begin
foo
rescue StandardError, SecurityError
bar
end
Example: EnforcedStyle: explicit (default)
# `explicit` will enforce using `rescue StandardError`
# instead of `rescue`.
# bad
begin
foo
rescue
bar
end
# good
begin
foo
rescue StandardError
bar
end
# good
begin
foo
rescue OtherError
bar
end
# good
begin
foo
rescue StandardError, SecurityError
bar
end
Missing top-level class documentation comment. Open
class BaseController < ActionController::Base
- 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
Inconsistent indentation detected. Open
def set_interface_type
@interface_type = InterfaceType.find(params[:id])
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Line is too long. [91/80] Open
render json: { associatedProblemIdentifiers: @project.associated_problem_identifiers },
- Exclude checks
Line is too long. [87/80] Open
new_params[service_symbol] = Service.find_by_id(project_params[service_symbol])
- Exclude checks