Showing 9,525 of 13,510 total issues
Function redirect_internal
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def redirect_internal(self, url, fp, errcode, errmsg, headers, data):
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 randrange
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def randrange(self, start, stop=None, step=1, int=int, default=None,
Avoid deeply nested control flow statements. Open
if self.trace:
print (" --- modulename: %s, funcname: %s"
% (modulename, code.co_name))
return self.localtrace
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 words[i] in hw_identifiers:
return int(
words[get_index(i)].replace(':', ''), 16)
except IOError:
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
Function find_head_package
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_head_package(self, parent, name):
if '.' in name:
i = name.find('.')
head = name[:i]
tail = name[i+1:]
- 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 __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
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):
Avoid deeply nested control flow statements. Open
if not re.match('^([^/:]+)://', address):
address = '%s://%s' % (protocol, address)
proxies[protocol] = address
Function getnode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def getnode():
"""Get the hardware address as a 48-bit positive integer.
The first time this runs, it may launch a separate program, which could
be quite slow. If all attempts to obtain the hardware address fail, we
- 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_301
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
Function http_error_401
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error_401(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 open_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def open_data(self, url, data=None):
"""Use "data" URL."""
if not isinstance(url, str):
raise IOError, ('data error', 'proxy support for data protocol currently not implemented')
# ignore POSTed 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
Function _randbelow
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _randbelow(self, n, _log=_log, int=int, _maxwidth=1L<<BPF,
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):
Avoid deeply nested control flow statements. Open
if token[-1] == '\n': # continued string
strstart = (lnum, start)
endprog = (endprogs[initial] or endprogs[token[1]] or
endprogs[token[2]])
contstr, needcont = line[start:], 1