File search.py
has 682 lines of code (exceeds 250 allowed). Consider refactoring. Open
import pickle
from collections import defaultdict
from urllib.parse import unquote
from flask import make_response, redirect, abort
Function mutations
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def mutations(self):
"""Render search form and results (if any) for proteins or mutations"""
task_id = request.args.get('task_id', None)
use_celery = current_app.config.get('USE_CELERY', False)
filter_manager = SearchViewFilters()
- 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 autocomplete_all
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def autocomplete_all(self):
"""
Supports:
Protein or gene:
{refseq_id}
- 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 search_proteins
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def search_proteins(
Function search_proteins
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def search_proteins(
phrase, limit=None, filter_manager=None,
features=('gene_symbol', 'refseq', 'gene_name', 'uniprot'),
engines=advanced_search_engines
):
- 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 progress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def progress(self, task_id):
celery_task = celery.AsyncResult(task_id)
status = celery_task.status
- 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"