Showing 44 of 94 total issues
Function get_empirical_formula
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_empirical_formula(self, cds=True):
""" Get the empirical formula
Returns:
:obj:`chem.EmpiricalFormula`: empirical formula
Function validate_implicit_relationships_are_set
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate_implicit_relationships_are_set(self, knowledge_base):
""" Check that there is only 1 :obj:`KnowledgeBase` and <= 1 :obj:`Cell` and that each relationship
to :obj:`KnowledgeBase` and :obj:`Cell` is set. This is necessary to enable the :obj:`KnowledgeBase` and
:obj:`Cell` relationships to be implicit in the Excel output and 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 get_direction
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_direction(self):
""" Returns the direction of the polymer feature defind by its strand and start/end coordinate
Returns:
:obj:`str`: direction (in ['forward', 'reverse'])
- 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_direction
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_direction(self):
""" Returns the direction of the polymer feature defind by its strand and start/end coordinate
Returns:
:obj:`PolymerDirection`: direction (in ['forward', 'reverse'])
- 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 serialize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def serialize(self, participants, encoded=None):
""" Serialize related object
Args:
participants (:obj:`list` of :obj:`SpeciesCoefficient`): Python representation of reaction participants
- 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 create_template
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_template(core_path, seq_path, taxon='prokaryote', write_schema=False, write_toc=True,
Function convert
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def convert(source_core, source_seq, dest_core, dest_seq, taxon='prokaryote', rewrite_seq_path=True, protected=True):
Function remove_metadata
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def remove_metadata(kb):
""" Remove metadata from Knowledge base
Args:
kb (:obj:`wc_utils.workbook.Workbook`): knowledge base
- 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
if cell.value and isinstance(cell.value, str):
cell.value = '!' + cell.value
else:
Function deserialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def deserialize(self, value, objects, decoded=None):
""" Deserialize value
Args:
value (:obj:`str`): String representation
objects (:obj:`dict`): dictionary of objects, grouped by model
- 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
if cell.value and isinstance(cell.value, str):
cell.value = '!' + cell.value
Function transform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def transform(filename, taxon):
# read
wb = openpyxl.load_workbook(filename=filename)
for ws in wb:
- 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 deserialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def deserialize(self, value, objects, decoded=None):
""" Deserialize value
Args:
value (:obj:`str`): String representation
objects (:obj:`dict`): dictionary of objects, grouped by model
- 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 deserialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def deserialize(cls, attribute, value, objects, compartment=None):
Function calc_structure
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def calc_structure(self, ph=7.4, major_tautomer=False, keep_hydrogens=False, dearomatize=False):
Function _serialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _serialize(species, coefficient, show_compartment=True, show_coefficient_sign=True):
""" Serialize values
Args:
species (:obj:`Species`): species
- 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 _append_metadata_entries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _append_metadata_entries(self, key, metadataObjs):
""" Appends wc_kb.core.Reference / wc_kb.core.DatabaseReference / wc_kb.core.Comments objects
to metadataObjs list
Input:
- 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_subseq
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_subseq(self, start, end, strand=PolymerStrand.positive):
""" Get a subsequence
Args:
start (:obj:`int`): start coordinate (1-indexed)
- 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 float(self.value)
Function _default
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _default(self):
args = self.app.pargs
if args.compare_files:
kb1 = wc_utils.workbook.io.read(args.core_path_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"