Showing 9,400 of 17,590 total issues
Function location_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def location_list(self, lookup='all'):
'''
Return a mapping of all location data for available providers
'''
data = {}
- 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
Avoid deeply nested control flow statements. Open
if _dnsname_match(value, hostname):
return
dnsnames.append(value)
Avoid deeply nested control flow statements. Open
if match is not None:
version_num = match
else:
errors.append(
'No version matching \'{0}\' found for package '
Function size_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def size_list(self, lookup='all'):
'''
Return a mapping of all image data for available providers
'''
data = {}
- 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
Avoid deeply nested control flow statements. Open
if match.group(1) == pkgtype:
# We've reached the targeted section
target_found = True
continue
Function add_metaclass
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_metaclass(metaclass):
"""Class decorator for creating a class with a metaclass."""
def wrapper(cls):
orig_vars = cls.__dict__.copy()
slots = orig_vars.get('__slots__')
- 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
Avoid deeply nested control flow statements. Open
if not str(task) in taskList:
continue
Avoid deeply nested control flow statements. Open
if salt.utils.versions.compare(ver1=version_num,
oper='==',
ver2=ver,
cmp_func=version_cmp,
ignore_epoch=ignore_epoch):
Avoid deeply nested control flow statements. Open
for ver in cver:
if salt.utils.versions.compare(ver1=version_num,
oper='>=',
ver2=ver,
cmp_func=version_cmp,
Function image_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def image_list(self, lookup='all'):
'''
Return a mapping of all image data for available providers
'''
data = {}
- 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
Avoid deeply nested control flow statements. Open
if alias not in interpolated_map:
interpolated_map[alias] = {}
if driver not in interpolated_map[alias]:
Function _get_node
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_node(name=None, instance_id=None, location=None):
if location is None:
location = get_location()
params = {'Action': 'DescribeInstances'}
- 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
Avoid deeply nested control flow statements. Open
if driver not in interpolated_map[alias]:
interpolated_map[alias][driver] = {}
interpolated_map[alias][driver][vm_name] = vm_details
Avoid deeply nested control flow statements. Open
if self.opts['parallel']:
parallel_data.append({
'opts': self.opts,
'name': name,
'alias': alias,
Function image_clone
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def image_clone(call=None, kwargs=None):
'''
Clones an existing image.
.. versionadded:: 2016.3.0
- 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
Function list_nodes_min
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def list_nodes_min(location=None, call=None):
'''
Return a list of the VMs that are on the provider. Only a list of VM names,
and their state, is returned. This is the minimum amount of information
needed to check for existing VMs.
- 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
Function __virtual__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __virtual__():
'''
Set up the libcloud functions and check for GCE configurations.
'''
if get_configured_provider() is False:
- 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
Avoid deeply nested control flow statements. Open
if 'existing' not in ret:
ret['existing'] = {}
ret['existing'][name] = ret['create'].pop(name)
Avoid deeply nested control flow statements. Open
if master_finger is not None:
master_profile['master_finger'] = master_finger
# Generate the minion keys to pre-seed the master:
for name, profile in create_list:
Function show_term_protect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def show_term_protect(name=None, instance_id=None, call=None, quiet=False):
'''
Show the details from EC2 concerning an instance's termination protection state
'''
- 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"