File io.py
has 1167 lines of code (exceeds 250 allowed). Consider refactoring. Open
""" IO utilities
:Author: Jonathan Karr <karr@mssm.edu>
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2016-11-28
Function write_worksheet
has a Cognitive Complexity of 118 (exceeds 5 allowed). Consider refactoring. Open
def write_worksheet(self, sheet_name, data, style=None, validation=None, protected=False, include_help_comments=False):
""" Write worksheet to file
Args:
sheet_name (:obj:`str`): sheet name
- 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_worksheet
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def read_worksheet(self, sheet_name, ignore_empty_final_rows=True, ignore_empty_final_cols=True):
""" Read data from Excel worksheet
Args:
sheet_name (:obj:`str`): sheet name
- 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_worksheet
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def read_worksheet(self, sheet_name, ignore_empty_final_rows=True, ignore_empty_final_cols=True):
""" Read data from file
Args:
sheet_name (:obj:`str`): sheet name
- 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
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def convert(source, destination, worksheet_order=None, style=None, ignore_extra_sheets=True):
""" Convert among Excel (.xlsx), comma separated (.csv), and tab separated formats (.tsv)
Args:
source (:obj:`str`): path to source file
- 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_worksheet
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def write_worksheet(self, sheet_name, data, style=None, validation=None, protected=False, include_help_comments=False):
""" Write worksheet to file
Args:
sheet_name (:obj:`str`): sheet name
Function get_options
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get_options(self):
""" Get options for :obj:`xlsxwriter.Worksheet.data_validation`
Returns
:obj:`dict`: dictonary of options for :obj:`xlsxwriter.Worksheet.data_validation`
- 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 20 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function apply
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def apply(self, ws, first_row, first_col, last_row, last_col, include_help_comments=False):
""" Apply validation to worksheet
Args:
ws (:obj:`xlsxwriter.Worksheet`): worksheet
- 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 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, input_title='', input_message='', show_input=True,
Function write
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def write(path, workbook,
Function write_cell
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def write_cell(self, xls_worksheet, sheet_name, i_row, i_col, value, format):
""" Write a value to a cell
Args:
xls_worksheet (:obj:`xlsxwriter.Worksheet`): Excel worksheet
- 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_format
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_format(i_row, i_col, style=style,
Function read_cell
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_cell(self, sheet_name, xls_worksheet, i_row, i_col):
""" Read the value of a cell
Args:
sheet_name (:obj:`str`): worksheet name
- 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_worksheet
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def write_worksheet(self, sheet_name, data, style=None, validation=None, protected=False):
""" Write worksheet to file
Args:
sheet_name (:obj:`str`): sheet name
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, path, title=None, description=None, keywords=None, version=None, language=None, creator=None):
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, path, title=None, description=None, keywords=None, version=None, language=None,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, path, title=None, description=None, keywords=None, version=None, language=None, creator=None):
Function apply
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def apply(self, ws, first_row, first_col, last_row, last_col, include_help_comments=False):
Function write_worksheet
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_worksheet(self, sheet_name, data, style=None, validation=None, protected=False, include_help_comments=False):
Function write_cell
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_cell(self, xls_worksheet, sheet_name, i_row, i_col, value, format):
Function write_worksheet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_worksheet(self, sheet_name, data, style=None, validation=None, protected=False):
Function apply_validation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def apply_validation(self, ws, first_row, first_col, last_row, last_col):
Function convert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def convert(source, destination, worksheet_order=None, style=None, ignore_extra_sheets=True):
Function write_worksheet
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def write_worksheet(self, sheet_name, data, style=None, validation=None, protected=False):
Function get_sheet_names
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_sheet_names(self):
""" Get names of files contained within path glob
Returns:
obj:`list` of `str`: list of file 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"