Function convert_json_record_to_array
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def convert_json_record_to_array(records, sheet_name, xlsform_predefined_column_names=None, xlsform_exclude_column_names=None):
rows = []
if len(records) < 1:
if xlsform_predefined_column_names:
rows.append(xlsform_predefined_column_names)
- 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 purify_posted_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def purify_posted_data(excel_as_dict):
for survey in excel_as_dict['survey']:
if survey['type'] in XLSFORM_EXCLUDE_FOR_DEFAULT:
if survey['default'] and survey['default'].strip():
try:
- 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 _yield_from_records
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _yield_from_records(records):
"""Reverse function of to_records
Trimmed down version of pyexcel.utils -> to_records.
"""
if len(records) < 1:
- 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 convert_excel_to_dict
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def convert_excel_to_dict(file_name=None, file_content=None, file_type='xlsx'):
book = pe.get_book(file_name=file_name, file_content=file_content, file_type=file_type)
excel_as_dict = OrderedDict()
for sheet in book:
records = []
- 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"