Showing 93 of 115 total issues
Avoid deeply nested control flow statements. Open
if i2 in used2:
continue
try:
Avoid deeply nested control flow statements. Open
for line in lines:
output.append(indent + line)
else:
Avoid deeply nested control flow statements. Open
if not keep_trailing_blank_lines:
delete_trailing_blanks(lines)
for line in lines:
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 rfind_nth
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rfind_nth(s, sub, n, start=0, end=float('inf')):
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 find_nth
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_nth(s, sub, n, start=0, end=float('inf')):
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 __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, value, alpha=None, center_of_mass=None):
""" Initialize an ExponentialMovingAverage.
Args:
value (:obj:`float`): initial average 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 any_checker
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def any_checker(value):
''' Convert value to its built-in data type if possible
Convert a string value to its built-in data type (integer, float, boolean, str
or list of these) if possible
- 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 remove_empty_final_cols
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def remove_empty_final_cols(self):
""" Remove empty final columns """
max_col = 0
for row in self:
for i_rev_col, cell in enumerate(reversed(row)):
- 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_repo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_repo(path='.', search_parent_directories=True):
""" Get a Git repository given the path to a file it contains
Args:
path (:obj:`str`): path to file or directory in a Git repository; if `path` doesn't exist
- 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_major_micro_species
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_major_micro_species(structure_or_structures, in_format, out_format,
ph=7.4, major_tautomer=False, keep_hydrogens=False, dearomatize=False):
""" Get the major protonation state of one or more compounds at a specific pH.
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 __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, sources, config, result):
"""
Args:
sources (:obj:`list` of :obj:`str`): list of sources of configuration values
config (:obj:`configobj.ConfigObj`): configuration
- 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 too many return
statements within this function. Open
return units1_expr.compare(units2_expr, operator.eq) or \
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return is_string(value)