Showing 9,400 of 17,590 total issues
Avoid deeply nested control flow statements. Open
if 'mask' in _config['files'][path]:
if not isinstance(_config['files'][path]['mask'], list):
return False, ('Configuration for inotify beacon '
'mask must be list.')
for mask in _config['files'][path]['mask']:
Avoid deeply nested control flow statements. Open
if re.match('state.*', job['fun']):
is_running = True
if is_running:
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, opts):
super(MasterKeys, self).__init__()
self.opts = opts
self.pub_path = os.path.join(self.opts['pki_dir'], 'master.pub')
self.rsa_path = os.path.join(self.opts['pki_dir'], 'master.pem')
- 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 verify_pubkey_sig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def verify_pubkey_sig(self, message, sig):
'''
Wraps the verify_signature method so we have
additional checks.
- 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_s3_key
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_s3_key():
'''
Get AWS keys from pillar or config
'''
- 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 is_file_ignored(opts, file_path):
continue
file_map[file_path] = os.path.getmtime(file_path)
Avoid deeply nested control flow statements. Open
if bucket_name in bucket:
bucket[bucket_name] += list(dirpaths)
bucket[bucket_name] = list(set(bucket[bucket_name]))
break
return ret
Function _file_lists
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _file_lists(load, form):
'''
Return a dict containing the file lists for files and dirs
'''
if 'env' in load:
- 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 k in s3_meta:
if 'Code' in k or 'Message' in k:
# assumes no duplicate keys, consisdent with current erro response.
meta_response.update(k)
# attempt use of human readable output first.
Avoid deeply nested control flow statements. Open
if relpath != '.':
# Don't add files outside the hgfs_root
if not relpath.startswith('../'):
ret.add(os.path.join(repo['mountpoint'], relpath))
split = split[0].rsplit('/', 1)
Avoid deeply nested control flow statements. Open
if ret is not None:
for header_name, header_value in ret['headers'].items():
name = header_name.strip()
value = header_value.strip()
if six.text_type(name).lower() == 'last-modified':
Avoid deeply nested control flow statements. Open
if 'Code' in k or 'Message' in k:
# assumes no duplicate keys, consisdent with current erro response.
meta_response.update(k)
# attempt use of human readable output first.
try:
Avoid deeply nested control flow statements. Open
if bucket_name in bucket:
bucket[bucket_name] += filepaths
break
return ret
Function envs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def envs(self, back=None, sources=False):
'''
Return the environments for the named backend or all backends
'''
back = self.backends(back)
- 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 file_path in files:
cached_file_path = _get_cached_file_name(bucket, saltenv, file_path)
log.info('%s - %s : %s', bucket, saltenv, file_path)
# load the file from S3 if it's not in the cache or it's old
Avoid deeply nested control flow statements. Open
if 'Code' in meta_response:
log.warning(
"'%s' response for bucket '%s'",
meta_response['Code'], bucket_name
)
Avoid deeply nested control flow statements. Open
if bucket_name in bucket_files:
bucket_files[bucket_name] += env_files
found = True
break
if not found:
Function __virtual__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __virtual__():
'''
Only load if subversion is available
'''
if __virtualname__ not in __opts__['fileserver_backend']:
- 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 dirs and not files:
ret['empty_dirs'].add(dir_rel_fn)
for fname in files:
Consider simplifying this complex logical expression. Open
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?