Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
for line in _fp:
line = salt.utils.stringutils.to_unicode(line)
line = line.partition('#')[0].strip()
if line:
if line.split()[-1] == '{':
Avoid deeply nested control flow statements. Open
if args[index].startswith('-') or (args[index] == '!' and
not swap):
args.insert(index, '')
else:
while (index + 1 < len(args) and
Function create_site
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_site(name, sourcepath, apppool='', hostheader='',
ipaddress='*', port=80, protocol='http', preload=''):
'''
Create a basic website in IIS.
- 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 line:
continue
if line.startswith('#'):
Avoid deeply nested control flow statements. Open
if node.getAttribute('type') == 'error':
_error_msg.append(node.childNodes[0].nodeValue)
elif self.__call_result['stderr'].strip():
Avoid deeply nested control flow statements. Open
if oem_release:
p_nfo['release'] = oem_release
ret.append(p_nfo)
Avoid deeply nested control flow statements. Open
if line.startswith('#'):
continue
try:
Avoid deeply nested control flow statements. Open
if not retcode == 0:
break
# provided list is '': users previously deleted from group
else:
Function convert
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def convert(device, permanent=False, keeplf=False):
'''
Convert ext2/3/4 to BTRFS. Device should be mounted.
Filesystem can be converted temporarily so the further processing and rollback is possible,
- 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 subvolume_delete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def subvolume_delete(name=None, names=None, commit=None):
'''
Delete the subvolume(s) from the filesystem
The user can remove one single subvolume (name) or multiple of
- 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 _read_config
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _read_config(conf_file=None):
'''
Reads the config file using configparser
'''
if conf_file is None:
- 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 tmp:
job_tag = tmp.groups()[0]
# filter on tags
if not tag:
Avoid deeply nested control flow statements. Open
for g_attr, g_attr_map in six.iteritems(g_attrs):
g_val = getattr(grant, g_attr)
if not g_val:
continue
_grant[g_attr_map] = g_val
Avoid deeply nested control flow statements. Open
if line.find('Type=oneshot') > 0:
# scripts that does a single job and then exit
is_oneshot = True
continue
Avoid deeply nested control flow statements. Open
for l in f:
l = salt.utils.data.decode(l, encoding='utf-8').rstrip()
l = re.sub(r'(.*)#(.*)', r'\1', l)
if '__virtualname__ =' in l and not virtualname:
virtualname = l.split()[2].strip("'").strip('"')
Function vm_netstats
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def vm_netstats(vm_=None):
'''
Return combined network counters used by the vms on this hyper in a
list of dicts:
- 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 _connect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _connect(user=None, password=None, host=None, port=None, database='admin', authdb=None):
'''
Returns a tuple of (user, host, port) with config, pillar, or default
values assigned to missing values.
'''
- 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 at
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def at(*args, **kwargs): # pylint: disable=C0103
'''
Add a job to the queue.
The 'timespec' follows the format documented in the
- 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 vm_diskstats
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def vm_diskstats(vm_=None):
'''
Return disk usage counters used by the vms on this hyper in a
list of dicts:
- 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 add_host
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_host(mac, name=None, ip=None, ddns=False, group=None,
supersede_host=False):
'''
Add a host object for the given mac.
- 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"