Showing 9,525 of 13,510 total issues
Function getfqdn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def getfqdn(name=''):
"""Get fully qualified domain name from name.
An empty argument is interpreted as meaning the local host.
- 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 http_error_307
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error_307(self, url, fp, errcode, errmsg, headers, data=None):
Function _readmark
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _readmark(self, chunk):
nmarkers = _read_short(chunk)
# Some files appear to contain invalid counts.
# Cope with this by testing for EOF.
try:
- 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 http_error_301
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, count=1, trace=1, countfuncs=0, countcallers=0,
ignoremods=(), ignoredirs=(), infile=None, outfile=None,
timing=False):
"""
@param count true iff it should count number of times each
- 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 isinstance(k, QName):
k = k.text
if isinstance(v, QName):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
Avoid deeply nested control flow statements. Open
if isinstance(v, QName):
v = qnames[v.text]
else:
v = _escape_attrib(v, encoding)
write(" %s=\"%s\"" % (qnames[k], v))
Avoid deeply nested control flow statements. Open
if not data:
break
buffers.append(data)
Avoid deeply nested control flow statements. Open
if isinstance(v, QName):
v = qnames[v.text]
else:
v = _escape_attrib_html(v, encoding)
# FIXME: handle boolean attributes
Function http_error_302
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error_302(self, url, fp, errcode, errmsg, headers, data=None):
Function _randbelow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _randbelow(self, n, _log=_log, int=int, _maxwidth=1L<<BPF,
Avoid deeply nested control flow statements. Open
if not re.match('^([^/:]+)://', address):
address = '%s://%s' % (protocol, address)
proxies[protocol] = address
Avoid deeply nested control flow statements. Open
if self.trace:
print (" --- modulename: %s, funcname: %s"
% (modulename, code.co_name))
return self.localtrace
Function load_module
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_module(self, name, stuff):
file, filename, info = stuff
(suff, mode, type) = info
try:
if type == BUILTIN_MODULE:
- 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 http_error
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error(self, url, fp, errcode, errmsg, headers, data=None):
Function http_error_303
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error_303(self, url, fp, errcode, errmsg, headers, data=None):
Function http_error_407
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error_407(self, url, fp, errcode, errmsg, headers, data=None):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, user, passwd, host, port, dirs,
Avoid deeply nested control flow statements. Open
if ((v[1]/total) >= consistency and
(delimiters is None or k in delimiters)):
delims[k] = v
consistency -= 0.01