Showing 272 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
class num_obs_abundances():
def get():
pipeline = pipelines.Pipeline().aggregate_total_array_length("observation")
for doc in p_manager.db_obj['pax'].aggregate(pipeline):
return doc['total']
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 50.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
class get_total_modifications:
def get():
pipeline = pipelines.Pipeline().aggregate_total_array_length("modifications")
for doc in rna_manager.db_obj['rna_modification'].aggregate(pipeline):
return doc['total']
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 50.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for i, concentration in enumerate(doc['concentrations']):
queried_species, distance_obj, concentration = dist_manager.get_dist_object(concentration, queried_species, distance_obj,
target_species, tax_field='species_name', org_format='tax_name')
doc['concentrations'][i] = concentration
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 43.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. 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
- Read upRead up
- Create a ticketCreate a ticket
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 43.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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"
Further reading
Line too long (97 > 79 characters) Open
docs(:obj:`Iter`): Documents that need calculation of taxon_distance and rearranging.
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Limit all lines to a maximum of 79 characters.
There are still many devices around that are limited to 80 character
lines; plus, limiting windows to 80 characters makes it possible to
have several windows side-by-side. The default wrapping on such
devices looks ugly. Therefore, please limit all lines to a maximum
of 79 characters. For flowing long blocks of text (docstrings or
comments), limiting the length to 72 characters is recommended.
Reports error E501.
Trailing whitespace Open
r = f_manager.simple_query_string(query_message, index, from_=from_,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Trailing whitespace is superfluous.
The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.
Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n \n bang = 12
Blank line contains whitespace Open
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Trailing whitespace is superfluous.
The warning returned varies on whether the line itself is blank,
for easier filtering for those who want to indent their blank lines.
Okay: spam(1)\n#
W291: spam(1) \n#
W293: class Foo(object):\n \n bang = 12