Function get_strain_info
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
def get_strain_info(sample):
"""
Get information about the refernce genome that should be used for a given sample
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_ftp_url
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_ftp_url(url):
ftp_url = None
attempts = 0
while attempts < 10:
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
Avoid deeply nested control flow statements. Open
if characteristic.category.lower() == 'organism':
organism = characteristic.value
if characteristic.category.lower() in SYNONYMS_PRIORITY_LIST[i]:
Avoid deeply nested control flow statements. Open
if characteristic.category.lower() in SYNONYMS_PRIORITY_LIST[i]:
try:
strain = "{}".format(characteristic.value)
except UnicodeEncodeError:
pass
Avoid deeply nested control flow statements. Open
if org_name.startswith(format_org_name(try_org)):
kegg_org_symbol = thing.split(' ')[0]
url = get_ref_seq_url(kegg_org_symbol)
spec_name = org_name.replace("-","_").replace(" ", "_")
full_strain_specificity ==True
Function get_json_ends
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_json_ends(tree):
ends = []
nodes = [tree]
while nodes:
new_nodes = []
- 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"