Showing 13 of 273 total issues
Function get
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def get(ko_number, _from=0, size=10, target_organism='Escherichia coli', taxon_distance=False):
result = []
query = {"orthodb_id": ko_number}
docs = rna_manager.db_obj['rna_modification'].find(filter=query, skip=_from,
limit=size, projection={'_id': 0})
- Read upRead up
- Create a ticketCreate a ticket
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
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(substrates, products, _from, size, bound, dof,
- Create a ticketCreate a ticket
Function get
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get(inchikey, threshold=0.6, target_species='homo sapiens', taxon_distance=False):
docs = mc_manager.get_similar_concentrations(inchikey, threshold=threshold)
doc = concentrations.get(inchikey, species=target_species, taxon_distance=False)
if doc != {}:
doc['similarity_score'] = 1.0
- Read upRead up
- Create a ticketCreate a ticket
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
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(substrates, products, _from, size, bound, taxon_distance=True,
- Create a ticketCreate a ticket
Function get_dist_object
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_dist_object(self, doc, queried_species, distance_obj,
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for i, mod in enumerate(mods):
queried_species, distance_obj, mod = dist_manager.get_dist_object(mod, queried_species, distance_obj,
target_organism, tax_field='organism', org_format='tax_name')
doc['modifications'][i] = mod
result.append(doc)
- Create a ticketCreate a ticket
Function get
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(query_message, index, from_, size, fields,
- Create a ticketCreate a ticket
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(query_message, index, from_, size, fields, _source_includes=[]):
- Create a ticketCreate a ticket
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(query_message, iof, index, from_, size, fields):
- Create a ticketCreate a ticket
Function create_app
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_app(apiName="DatanatorAPI.yaml", entryModule="datanator_rest_api.routes",
- Create a ticketCreate a ticket
Function page
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def page(self, _from=0, size=10):
"""Calculate page information.
Args:
_from (:obj:`int`, optional): Page starting from. Defaults to 0.
- Read upRead up
- Create a ticketCreate a ticket
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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get(parameter):
if parameter == 'k_is':
docs =r_manager.db_obj['sabio_rk_old'].aggregate([
{"$project": {"parameter": 1}},
{"$match": {"parameter.observed_name": "Ki"}},
- Read upRead up
- Create a ticketCreate a ticket
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_dist_object
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_dist_object(self, doc, queried_species, distance_obj,
target_species, org_format='tax_id',
tax_field='species_name', obj_name='taxon_distance'):
"""Return taxon_distance object for frontend.
- Read upRead up
- Create a ticketCreate a ticket
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"