Function run
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def run(self, path, models=None,
ignore_missing_models=None, ignore_extra_models=None, ignore_sheet_order=None,
include_all_attributes=False, ignore_missing_attributes=None, ignore_extra_attributes=None,
ignore_attribute_order=None, validate=None):
""" Read a list of model objects from file(s) and, optionally, validate them
- 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 18 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(self, path, model, models=None, get_related=True, include_all_attributes=False, validate=None,
Function run
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def run(self, path, models=None,
Function validate_implicit_relationships_are_set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def validate_implicit_relationships_are_set(self, model, root_model):
""" Check that there is only one instance of :obj:`root_model` and that each relationship to
:obj:`root_model` is set. This is necessary to enable the relationships to :obj:`root_model`
to not be exported in workbooks, and instead added by :obj:`Reader.run`.
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def run(self, path, model, models=None, get_related=True, include_all_attributes=False, validate=None,
title=None, description=None, keywords=None, version=None, language=None, creator=None,
write_schema=False, write_toc=True, extra_entries=0, data_repo_metadata=False, schema_package=None,
protected=True):
""" Write a list of model classes to an Excel file, with one worksheet for each model, or to
- 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
for cls_obj in cls_objects:
setattr(cls_obj, attr.name, model)
# validate
config = wc_lang.config.core.get_config()['wc_lang']['io']
Function create_template
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_template(path, write_schema=False, write_toc=True,
Function validate_implicit_relationships
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_implicit_relationships(cls, root_model):
""" Check that relationships to :obj:`root_model` do not need to be explicitly exported because
they can be inferred by :obj:`Reader.run`. This is necessary to enable the relationships
to :obj:`root_model` to not be exported in workbooks, and instead added by :obj:`Reader.run`.
- 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"