Method parse_hard_disk_volume
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_hard_disk_volume(args)
logger.debug(format(_('parse_hard_disk_volume(): args=%<args>s'), args: args))
disk = {}
disk[:id] = args['id'] if args.key?('id')
disk[:volid] = args['volid'] if args.key?('volid')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method volume_type?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def volume_type?(args, type)
if args.key?('storage_type')
args['storage_type'] == type
else
Fog::Proxmox::DiskHelper.cloud_init?(args['volid']) if type == 'cloud_init'
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse_typed_volume
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_typed_volume(args, type)
logger.debug("parse_typed_volume(#{type}): args=#{args}")
disk = parse_hard_disk_volume(args) if volume_type?(args,
'hard_disk') || volume_type?(args, 'mp') || volume_type?(args, 'rootfs')
disk = parse_server_cloudinit(args) if volume_type?(args, 'cloud_init')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parsed_typed_volumes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parsed_typed_volumes(args, type, parsed_vm)
logger.debug("parsed_typed_volumes(#{type}): args=#{args}")
volumes_attributes = args['volumes_attributes']
unless ForemanFogProxmox::Value.empty?(args['config_attributes'])
volumes_attributes ||= args['config_attributes']['volumes_attributes']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"