Showing 9,525 of 13,510 total issues
Avoid deeply nested control flow statements. Open
if name in ("__dict__", "__weakref__"):
continue
# mangled names
elif name.startswith('__') and not name.endswith('__'):
names.append('_%s%s' % (c.__name__, name))
Function compile_dir
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def compile_dir(dir, maxlevels=10, ddir=None,
Avoid deeply nested control flow statements. Open
if not compile_dir(arg, maxlevels, ddir,
force, rx, quiet):
success = 0
else:
Function write_pci_reg
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_pci_reg( self, bus, device, function, address, value, size ):
Function VARS_list_EFI_variables
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def VARS_list_EFI_variables ( self, infcls=2 ):
varlist = os.listdir('/sys/firmware/efi/vars')
variables = dict()
for v in varlist:
name = v[:-37]
- 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 _repr_iterable
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _repr_iterable(self, x, level, left, right, maxiter, trail=''):
Function write_pci_reg
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_pci_reg( self, bus, device, function, address, value, size ):
Function VARS_get_efivar_from_sys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def VARS_get_efivar_from_sys( self, filename ):
off = 0
buf = list()
hdr = 0
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 getresponse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def getresponse(self, buffering=False):
"Get the response from the server."
# if a prior response has been completed, then forget about it.
if self.__response and self.__response.isclosed():
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read(self, amt=None):
if self._line_consumed:
return self._file.read(amt)
assert self._line_left
if amt is None or amt > self._line_left:
- 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 VARS_set_EFI_variable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def VARS_set_EFI_variable(self, name, guid, value ):
ret = True
if not name:
name = '*'
if not guid:
- 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 smi
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def smi(argv):
try:
interrupts = Interrupts( _cs )
except RuntimeError, msg:
print msg
- 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_pci_reg
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_pci_reg( self, bus, device, function, address, value, size ):
Avoid deeply nested control flow statements. Open
if ans is None:
ans = self.__namespaces.get(aprefix)
if ans is not None:
Function EFIVARS_list_EFI_variables
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def EFIVARS_list_EFI_variables ( self, infcls=2 ):
varlist = os.listdir('/sys/firmware/efi/efivars')
variables = dict()
for v in varlist:
name = v[:-37]
- 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_pci_reg
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_pci_reg( self, bus, device, function, offset, value, size = 4 ):
Function _module_relative_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _module_relative_path(module, path):
if not inspect.ismodule(module):
raise TypeError, 'Expected a module: %r' % module
if path.startswith('/'):
raise ValueError, 'Module-relative files may not have absolute paths'
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host='', port=0, local_hostname=None,
Function docclass
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def docclass(self, object, name=None, mod=None, funcs={}, classes={},
Function save_reduce
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def save_reduce(self, func, args, state=None,