Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
for host in ret:
cret[host] = ret[host]['ret']
return cret
Function locate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def locate(pattern, database='', limit=0, **kwargs):
'''
Performs a file lookup. Valid options (and their defaults) are::
basename=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
for ip_ in host_ips:
containers = proxy_lists[container['Image']].setdefault('ipv4', {}).setdefault(dock_port['PrivatePort'], [])
container_network_footprint = '{0}:{1}'.format(ip_, dock_port['PublicPort'])
if with_container_id:
value = (container_network_footprint, container_id)
Function recv
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def recv(files, dest):
'''
Used with salt-cp, pass the files dict, and the destination.
This function receives small fast copy files from the master via salt-cp.
- 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 salt.utils.network.in_subnet(cidr, [ip_]):
good_ips.append(ip_)
host_ips = list(set(good_ips))
Avoid deeply nested control flow statements. Open
if with_container_id:
value = (container_network_footprint, container_id)
else:
value = container_network_footprint
if value not in containers:
Avoid deeply nested control flow statements. Open
if acl_type == 'acl':
ret[dentry][entity] = [{"": vals}]
elif acl_type == 'default':
if 'defaults' not in ret[dentry]:
ret[dentry]['defaults'] = {}
Function _exec
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _exec(client, tgt, fun, arg, timeout, tgt_type, ret, kwarg, **kwargs):
fcn_ret = {}
seen = 0
if 'batch' in kwargs:
_cmd = client.cmd_batch
- 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 acl_type == 'acl':
ret[dentry][entity].append({usergroup: vals})
elif acl_type == 'default':
if 'defaults' not in ret[dentry]:
ret[dentry]['defaults'] = {}
Avoid deeply nested control flow statements. Open
if value not in containers:
containers.append(value)
Function delta_import
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delta_import(handler, host=None, core_name=None, options=None, extra=None):
'''
Submits an import command to the specified handler using specified options.
This command can only be run if the minion is configured with
solr.type=master
- 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 create_api_integration
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_api_integration(restApiId, resourcePath, httpMethod, integrationType, integrationHttpMethod,
uri, credentials, requestParameters=None, requestTemplates=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates an integration for a given method in a given API.
- 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 shutdown
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def shutdown(zone, reboot=False, single=False, altinit=None, smf_options=None):
'''
Gracefully shutdown the specified zone.
zone : string
- 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 ping
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ping(host=None, core_name=None):
'''
Does a health check on solr, makes sure solr can talk to the indexes.
host : str (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
Function mod_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def mod_list(only_persist=False):
'''
Return a list of the loaded module names
CLI Example:
- 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 write_pem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def write_pem(text, path, overwrite=True, pem_type=None):
'''
Writes out a PEM string fixing any formatting or whitespace
issues before writing.
- 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 _create_and_add_parameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _create_and_add_parameters(params):
'''
Parses the configuration and creates Parameter instances.
'''
global _current_parameter
- 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 optimize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def optimize(host=None, core_name=None):
'''
Search queries fast, but it is a very expensive operation. The ideal
process is to run this with a master/slave configuration. Then you
can optimize the master, and push the optimized index to the slaves.
- 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 get_rule_handle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_rule_handle(table='filter', chain=None, rule=None, family='ipv4'):
'''
Get the handle for a particular rule
This function accepts a rule in a standard nftables command format,
- 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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start(name=None,
user=None,
group=None,
chroot=None,
caps=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"