Block has too many lines. [26/25] Open
TRANSFORMERS_HASH_INSTANCE_NAMES.each do |tname|
plural_tname = tname.to_s.pluralize
# NAME : defaults_for(key)
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Use uppercase heredoc delimiters. Open
end_eval
- Read upRead up
- Exclude checks
This cop checks that your heredocs are using the configured case. By default it is configured to enforce uppercase heredocs.
Example: EnforcedStyle: uppercase (default)
# bad
<<-sql
SELECT * FROM foo
sql
# good
<<-SQL
SELECT * FROM foo
SQL
Example: EnforcedStyle: lowercase
# bad
<<-SQL
SELECT * FROM foo
SQL
# good
<<-sql
SELECT * FROM foo
sql
Pass __FILE__
and __LINE__
to eval
method, as they are used by backtraces. Open
class_eval <<-end_eval
- Read upRead up
- Exclude checks
This cop checks eval
method usage. eval
can receive source location
metadata, that are filename and line number. The metadata is used by
backtraces. This cop recommends to pass the metadata to eval
method.
Example:
# bad
eval <<-RUBY
def do_something
end
RUBY
# bad
C.class_eval <<-RUBY
def do_something
end
RUBY
# good
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
def do_something
end
RUBY
# good
C.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def do_something
end
RUBY
Use uppercase heredoc delimiters. Open
end_eval
- Read upRead up
- Exclude checks
This cop checks that your heredocs are using the configured case. By default it is configured to enforce uppercase heredocs.
Example: EnforcedStyle: uppercase (default)
# bad
<<-sql
SELECT * FROM foo
sql
# good
<<-SQL
SELECT * FROM foo
SQL
Example: EnforcedStyle: lowercase
# bad
<<-SQL
SELECT * FROM foo
SQL
# good
<<-sql
SELECT * FROM foo
sql
Do not place comments on the same line as the end
keyword. Open
end ## class
- Read upRead up
- Exclude checks
This cop checks for comments put on the same line as some keywords.
These keywords are: begin
, class
, def
, end
, module
.
Note that some comments (such as :nodoc:
and rubocop:disable
) are
allowed.
Example:
# bad
if condition
statement
end # end if
# bad
class X # comment
statement
end
# bad
def x; end # comment
# good
if condition
statement
end
# good
class X # :nodoc:
y
end
Pass __FILE__
and __LINE__
to eval
method, as they are used by backtraces. Open
class_eval <<-end_eval
- Read upRead up
- Exclude checks
This cop checks eval
method usage. eval
can receive source location
metadata, that are filename and line number. The metadata is used by
backtraces. This cop recommends to pass the metadata to eval
method.
Example:
# bad
eval <<-RUBY
def do_something
end
RUBY
# bad
C.class_eval <<-RUBY
def do_something
end
RUBY
# good
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
def do_something
end
RUBY
# good
C.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def do_something
end
RUBY
Use uppercase heredoc delimiters. Open
end_eval
- Read upRead up
- Exclude checks
This cop checks that your heredocs are using the configured case. By default it is configured to enforce uppercase heredocs.
Example: EnforcedStyle: uppercase (default)
# bad
<<-sql
SELECT * FROM foo
sql
# good
<<-SQL
SELECT * FROM foo
SQL
Example: EnforcedStyle: lowercase
# bad
<<-SQL
SELECT * FROM foo
SQL
# good
<<-sql
SELECT * FROM foo
sql
Pass __FILE__
and __LINE__
to eval
method, as they are used by backtraces. Open
class_eval <<-end_eval
- Read upRead up
- Exclude checks
This cop checks eval
method usage. eval
can receive source location
metadata, that are filename and line number. The metadata is used by
backtraces. This cop recommends to pass the metadata to eval
method.
Example:
# bad
eval <<-RUBY
def do_something
end
RUBY
# bad
C.class_eval <<-RUBY
def do_something
end
RUBY
# good
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
def do_something
end
RUBY
# good
C.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def do_something
end
RUBY
Use uppercase heredoc delimiters. Open
end_eval
- Read upRead up
- Exclude checks
This cop checks that your heredocs are using the configured case. By default it is configured to enforce uppercase heredocs.
Example: EnforcedStyle: uppercase (default)
# bad
<<-sql
SELECT * FROM foo
sql
# good
<<-SQL
SELECT * FROM foo
SQL
Example: EnforcedStyle: lowercase
# bad
<<-SQL
SELECT * FROM foo
SQL
# good
<<-sql
SELECT * FROM foo
sql
Pass __FILE__
and __LINE__
to eval
method, as they are used by backtraces. Open
class_eval <<-end_eval
- Read upRead up
- Exclude checks
This cop checks eval
method usage. eval
can receive source location
metadata, that are filename and line number. The metadata is used by
backtraces. This cop recommends to pass the metadata to eval
method.
Example:
# bad
eval <<-RUBY
def do_something
end
RUBY
# bad
C.class_eval <<-RUBY
def do_something
end
RUBY
# good
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
def do_something
end
RUBY
# good
C.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def do_something
end
RUBY
Use uppercase heredoc delimiters. Open
end_eval
- Read upRead up
- Exclude checks
This cop checks that your heredocs are using the configured case. By default it is configured to enforce uppercase heredocs.
Example: EnforcedStyle: uppercase (default)
# bad
<<-sql
SELECT * FROM foo
sql
# good
<<-SQL
SELECT * FROM foo
SQL
Example: EnforcedStyle: lowercase
# bad
<<-SQL
SELECT * FROM foo
SQL
# good
<<-sql
SELECT * FROM foo
sql
Pass __FILE__
and __LINE__
to eval
method, as they are used by backtraces. Open
class_eval <<-end_eval
- Read upRead up
- Exclude checks
This cop checks eval
method usage. eval
can receive source location
metadata, that are filename and line number. The metadata is used by
backtraces. This cop recommends to pass the metadata to eval
method.
Example:
# bad
eval <<-RUBY
def do_something
end
RUBY
# bad
C.class_eval <<-RUBY
def do_something
end
RUBY
# good
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
def do_something
end
RUBY
# good
C.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def do_something
end
RUBY