lib/zanzibar/actions/bundle.rb
Method download_one_secret
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def download_one_secret(scrt_id, label, path, args, name = nil)
Use the return of the conditional for variable assignment and comparison. Open
Open
if label == 'Password'
path = zanzibar(args).get_username_and_password_and_save(scrt_id, path, name)
else
path = zanzibar(args).download_secret_file(scrt_id: scrt_id,
type: label,
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression. Open
Open
if @settings['secret_dir']
- Read upRead up
- Exclude checks
Use a guard clause instead of wrapping the code inside a conditional expression
Example:
# bad
def test
if something
work
end
end
# good
def test
return unless something
work
end
# also good
def test
work if something
end
# bad
if something
raise 'exception'
else
ok
end
# good
raise 'exception' if something
ok
Method Zanzibar::Actions::Bundle#zanzibar
is defined at both lib/zanzibar/actions/bundle.rb:27 and lib/zanzibar/actions/bundle.rb:147. Open
Open
def zanzibar(args)
- Read upRead up
- Exclude checks
This cop checks for duplicated instance (or singleton) method definitions.
Example:
# bad
def duplicated
1
end
def duplicated
2
end
Example:
# bad
def duplicated
1
end
alias duplicated other_duplicated
Example:
# good
def duplicated
1
end
def other_duplicated
2
end