Showing 425 of 542 total issues
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, min=None, max=None, none=False, default=None, default_cleaned_value=None,
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, min=float('nan'), max=float('nan'), nan=True,
Function validate
has a Cognitive Complexity of 11 (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 validate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate(self, obj, value):
""" Determine if :obj:`value` is a valid value for this StringAttribute
Args:
obj (:obj:`Model`): class 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 __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, enum_class, none=False, default=None, default_cleaned_value=None, none_value=None, verbose_name='', description='',
Function gen_merge_map
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def gen_merge_map(self, other):
""" Create a dictionary that maps instances of objects in another model to objects
in a model
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 get_xlsx_validation
has a Cognitive Complexity of 11 (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 get_xlsx_validation
has a Cognitive Complexity of 11 (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 write_toc
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def write_toc(self, writer, models, schema_name, date, doc_metadata, grouped_objects, write_schema=False, protected=True):
""" Write a worksheet with a table of contents
Args:
writer (:obj:`wc_utils.workbook.io.Writer`): io writer
- 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_model
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def read_model(self, reader, sheet_name, schema_name, model, include_all_attributes=True,
Function run
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run():
#########################
# import schema
import schema as address_book
PersonType = address_book.Person.type.enum_class
Function make_data_schema_migration_conf_file_cmd
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_data_schema_migration_conf_file_cmd(data_repo_dir, schema_file_url, files_to_migrate,
add_to_repo=True):
""" Make a data-schema migration configuration file from CLI input
Args:
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, none=True, default=None, default_cleaned_value=None,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, init_value=None, default=None, default_cleaned_value=None, none_value=None, verbose_name='', description='',
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, max=None, none=False, default=None, default_cleaned_value=None,
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, max=float('nan'), nan=True, default=float('nan'), default_cleaned_value=float('nan'),
Function write_sheet
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_sheet(self, writer, model, data, headings, metadata_headings, validation,
Function write_sheet
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_sheet(self, writer, model, data, headings, metadata_headings, validation,
Function migrate_over_schema_sequence
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def migrate_over_schema_sequence(migration_spec):
""" Migrate some model files over a sequence of schemas
Args:
migration_spec (:obj:`MigrationSpec`): a migration specification
- 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_all_analyzed_exprs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _migrate_all_analyzed_exprs(self, all_models):
""" Migrate all model instances' :obj:`ParsedExpression`\ s
This must be done after all migrated models have been created.
- 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"