ManageIQ/manageiq-providers-ovirt

View on GitHub

Showing 37 of 37 total issues

Wrap expressions with varying precedence with parentheses to avoid ambiguity.
Open

host_os && host_os.type || host.type

Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
Open

rescue Exception => e
handle_credentials_verification_error(e)

Useless method definition detected.
Open

def set_or_default_hardware_field_values(vm)
super(vm)
end

Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
Open

return unless content = customization_template_content

Avoid hard coding large quantities of data in code. Prefer reading the data from an external source.
Open

EVENT_CODES = {
# Code Description
0 => "UNASSIGNED",
1 => "VDC_START",
2 => "VDC_STOP",

Use == if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
Open

return unless content = customization_template_content

Use filter_map instead.
Open

disks_spec.collect do |disk_spec|
disk = prepare_disk_for_add(disk_spec)
_log.info("disk: #{disk.inspect}")
disk
end.compact

Do not suppress exceptions.
Open

rescue LoadError
Severity: Minor
Found in Rakefile by rubocop

Empty class detected.
Open

class ManageIQ::Providers::Ovirt::InfraManager::Scanning
end

Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
Open

rescue Exception => err
_log.error("#{log_header} Unhandled exception during perf data collection: [#{err}], class: [#{err.class}]")
_log.error("#{log_header} Timings at time of error: #{Benchmark.current_realtime.inspect}")
_log.log_backtrace(err)
raise

Unused method argument - host. If it's necessary, use _ or _host as an argument name to indicate that it won't be used. If it's unnecessary, remove it.
Open

def vm_hardware_guest_devices(persister_hardware, vm, addresses, host)

Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
Open

rescue Exception => err
msg = "#{log_header}: Connection to [#{ems_display_text}] failed for VM:[#{@vm_cfg_file}] with error [#{err}] after [#{Time.now - st}] seconds"
$log.error msg
raise

metadata['rubygems_mfa_required'] must be set to 'true'.
Open

Gem::Specification.new do |spec|
spec.name = "manageiq-providers-ovirt"
spec.version = ManageIQ::Providers::Ovirt::VERSION
spec.authors = ["ManageIQ Authors"]
 
 
Severity: Minor
Found in manageiq-providers-ovirt.gemspec by rubocop

Use any?(ExtManagementSystem) instead of block.
Open

ems_in_list = targets.any? { |t| t.kind_of?(ExtManagementSystem) }

Duplicate branch body detected.
Open

else

Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?
Open

rescue Exception => err
_log.warn("#{log_prefix} Event Monitor Stop errored because [#{err.message}]")
_log.warn("#{log_prefix} Error details: [#{err.details}]")
_log.log_backtrace(err)

Use filter_map instead.
Open

vm.storages.collect(&:ems_ref).compact.each { |ems_ref| add_target!(:storagedomains, ems_ref) } unless vm.storages.nil?
Severity
Category
Status
Source
Language