Showing 71 of 192 total issues
Avoid deeply nested control flow statements. Open
Open
if pred.left.axis in ('@', 'attribute'):
if _remove_attribute_node(node, context, pred.left):
# remove from the xast
xast_c.predicates.remove(pred)
elif pred.left.axis in (None, 'child'):
Avoid deeply nested control flow statements. Open
Open
if next.type == 'OPEN_PAREN':
# point 2
if tok.value in NODE_TYPES:
tok.type = 'NODETYPE'
else:
Function xmlobjectform_factory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def xmlobjectform_factory(model, form=XmlObjectForm, fields=None, exclude=None,
widgets=None, max_num=None, label=None, can_delete=True,
extra=None, can_order=False):
"""Dynamically generate a new :class:`XmlObjectForm` class using the
specified :class:`eulxml.xmlmap.XmlObject` class.
- 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
Open
if schema_obj is None:
# if xsd schema is directly defined, use that
if 'XSD_SCHEMA' in defined_attrs:
schema_obj = load_xmlobject_from_file(defined_attrs['XSD_SCHEMA'],
XsdSchema)
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, true, false, *args, **kwargs):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get(self, xpath, node, context, mapper, xast):
Function _html_subform_output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _html_subform_output(self, subform=None, name=None, gen_html=None, content=None,
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get(self, xpath, node, context, mapper, xast):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, format=None, normalize=False, *args, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, format=None, normalize=False, *args, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, format=None, normalize=False, *args, **kwargs):
Function delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def delete(self, xpath, xast, node, context, mapper):
Function delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def delete(self, xpath, xast, node, context, mapper):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, normalize=False, choices=None, *args, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, data=None, instance=None, prefix=None, initial={}, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, node, context, mapper, xast):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, node_class, instantiate_on_get=False, *args, **kwargs):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, normalize=False, choices=None, *args, **kwargs):
Function _html_output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, xpath, format=None, normalize=False, *args, **kwargs):