Showing 425 of 542 total issues
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, related_class, related_name='',
Function get_xlsx_validation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_xlsx_validation(self, sheet_models=None, doc_metadata_model=None):
""" Get XLSX validation
Args:
sheet_models (:obj:`list` of :obj:`Model`, optional): models encoded as separate sheets
- 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 start
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def start(self, parts):
if len(set([part.serialize() for part in parts])) < len(parts):
raise ValueError('Reaction participants cannot be repeated')
if self.species:
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, related_class, related_name='',
init_value=None, default=None, default_cleaned_value=None, none_value=None,
related_init_value=None, related_default=None,
min_related=0, max_related=float('inf'), min_related_rev=0, max_related_rev=float('inf'),
verbose_name='', verbose_related_name='', description=''):
- 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 validate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def validate(self, obj, value):
""" Determine if :obj:`value` is a valid value of the attribute
Args:
obj (:obj:`Model`): object being validated
- 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_immediate_children
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_immediate_children(self, kind=None, __type=None, **kwargs):
""" Get a kind of immediate children
If :obj:`kind` is :obj:`None`, children are defined to be the values of the related attributes defined
in each 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
Function init_attributes
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def init_attributes(cls):
""" Initialize attributes """
cls.Meta.attributes = collections.OrderedDict()
for attr_name in sorted(dir(cls)):
- 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 run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run(self, path, schema_name=None, models=None,
allow_multiple_sheets_per_model=False,
ignore_missing_models=False, ignore_extra_models=False,
ignore_sheet_order=False,
include_all_attributes=True, ignore_missing_attributes=False, ignore_extra_attributes=False,
- 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_sheet
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def write_sheet(self, writer, model, data, headings, metadata_headings, validation,
extra_entries=0, merge_ranges=None, protected=False):
""" Write data to sheet
Args:
- 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 run
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(self, path, schema_name=None, models=None,
allow_multiple_sheets_per_model=False,
ignore_missing_models=False, ignore_extra_models=False,
ignore_sheet_order=False,
include_all_attributes=True, ignore_missing_attributes=False, ignore_extra_attributes=False,
Function get_fields
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_fields(cls, schema_name, date, doc_metadata, doc_metadata_model, model_metadata, include_all_attributes=True, sheet_models=None):
""" Get the attributes, headings, and validation for a worksheet
Args:
cls (:obj:`type`): Model type (subclass of :obj:`Model`)
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, pattern, flags=0, min_length=0, max_length=None,
Function _validate_renamed_models
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _validate_renamed_models(self):
""" Validate renamed models
Ensure that renamed models:
- 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 deserialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def deserialize(cls, model_cls, value, objects):
""" Deserialize :obj:`value` into an :obj:`Expression`
Args:
model_cls (:obj:`type`): :obj:`Expression` class or subclass
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, registry, choices=None, none=True, default=None, default_cleaned_value=None,
none_value=None, verbose_name='', description="Units (e.g. 'second', 'meter', or 'gram')",
primary=False, unique=False, unique_case_insensitive=False):
"""
Args:
- 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 _migrate_expression
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _migrate_expression(self, existing_analyzed_expr):
""" Migrate a model instance's :obj:`ParsedExpression.expression`
The :obj:`ParsedExpression` syntax supports model type names in a Name.model_id notation.
If a model type name changes then these must be migrated.
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, registry, choices=None, none=True, default=None, default_cleaned_value=None,
none_value=None, verbose_name='', description="Units (e.g. 'second', 'meter', or 'gram')",
primary=False, unique=False, unique_case_insensitive=False):
"""
Args:
- 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 deserialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def deserialize(self, value):
""" Deserialize value
Args:
value (:obj:`str`): semantically equivalent representation
- 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_xlsx_validation
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_xlsx_validation(self, sheet_models=None, doc_metadata_model=None):
""" Get XLSX validation
Args:
sheet_models (:obj:`list` of :obj:`Model`, optional): models encoded as separate sheets
- 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 gbl
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def gbl(self, *args):
parts = []
for arg in args:
if isinstance(arg, lark.lexer.Token) and \
arg.type == 'SPECIES_STOICHIOMETRY__SPECIES__COMPARTMENT__ID':
- 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"