lib/old_tasks/zebra.rake
Block has too many lines. [71/25] Open
Open
namespace :zebra do
desc 'Set the kete user password in the zebradb/keteaccess file'
task :set_keteaccess do
`htpasswd -cbp #{Rails.root}/zebradb/keteaccess kete #{ENV['ZEBRA_PASSWORD']}`
end
- 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.
HACK found Open
Open
# HACK: no version flag on zebrasrv, read value out of last line of man entry
- Exclude checks
Avoid rescuing without specifying an error class. Open
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
Avoid using rescue
in its modifier form. Open
Open
should_add_record = false if zoom_db.respond_to?(:has_zoom_record?) && zoom_db.has_zoom_record?(the_record_id) 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
Prefer $ERROR_INFO
from the stdlib 'English' module (don't forget to require it) over $!
. Open
Open
puts " Error while adding record to #{prefix} zebra instance (#{$!})."
- Exclude checks