Showing 425 of 542 total issues
Function get_obj_units
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_obj_units(obj):
""" Get units used in a model object and related objects
Args:
obj (:obj:`core.Model`): model object
- 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 lcl
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def lcl(self, *args):
parts = []
for arg in args:
if isinstance(arg, lark.tree.Tree):
if arg.data == 'lcl_reactants':
- 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 is_equal
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def is_equal(self, other):
""" Determine if two reaction equations are semantically equivalent
Args:
other (:obj:`ReactionEquation`): other reaction equation
- 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 from_dict
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def from_dict(self, dict_value):
""" Set value from a dictionary representation
Args:
dict_value (:obj:`dict`): dictionary 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 deserialize
has a Cognitive Complexity of 10 (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 serialized_format
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def serialized_format(self, value):
if value in [ChemicalStructureFormat.inchi, ChemicalStructureFormat.smiles]:
if self._serialized_format in [ChemicalStructureFormat.inchi, ChemicalStructureFormat.smiles]:
if value != self._serialized_format:
self._serialized_format = value
- 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 test_eval
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def test_eval(self, values=1., with_units=False):
""" Test evaluate this :obj:`ParsedExpression` with the value of all models given by :obj:`values`
This is used to validate this :obj:`ParsedExpression`, as well as for testing.
- 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_str
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_str(self, obj_tables_token_to_str, with_units=False, number_units=' * __dimensionless__'):
""" Generate string representation of expression, e.g. for evaluation by :obj:`eval`
Args:
obj_tables_token_to_str (:obj:`callable`): method to get string representation of a token
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def validate(self):
""" Determine if the object is valid
Returns:
:obj:`InvalidObject` or None: :obj:`None` if the object is valid,
- 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 save_out_workbook
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def save_out_workbook(format, objs, schema_name, doc_metadata, model_metadata, models,
write_toc=False, write_schema=False, write_empty_models=True, write_empty_cols=True,
protected=True):
"""
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 has_attr_vals
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def has_attr_vals(self, __type=None, __check_attr_defined=True, **kwargs):
""" Check if the type and values of the attributes of an object match a set of conditions
Args:
__type (:obj:`types.TypeType` or :obj:`tuple` of :obj:`types.TypeType`): subclass(es) of :obj:`Model`
- 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 10 (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_all_related
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_all_related(objs, forward=True, reverse=True):
""" Optimally obtain all objects related to objects in :obj:`objs`
The set of all :obj:`Model`\ s can be viewed as a graph whose nodes are :obj:`Model` instances
and whose edges are related connections. Because related edges are bi-directional, this graph
- 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 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run(self, path, objects, schema_name=None, doc_metadata=None, model_metadata=None,
models=None, get_related=True, include_all_attributes=True, validate=True,
title=None, description=None, keywords=None, version=None, language=None, creator=None,
write_toc=True, write_schema=False, write_empty_models=True, write_empty_cols=True,
extra_entries=0, group_objects_by_model=True, data_repo_metadata=False, schema_package=None,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, min_length=0, max_length=float('inf'), default=None, none_value=None, verbose_name='', description='',
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, min_length=0, max_length=float('inf'), default=None, none_value=None, verbose_name='', description='',
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, verbose_name='', description='Enter a path to a local file or directory',
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, min_length=0, max_length=float('inf'), default=None, none_value=None, verbose_name='', description='',
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, none=True, default=None, default_cleaned_value=None, none_value=None,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, none=True, default=None, default_cleaned_value=None, none_value=None,