Showing 340 of 340 total issues
Function from_more_than_one_source
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def from_more_than_one_source(self):
"""Counts mutations that have annotations in more
than one source (eg. in both: TCGA and ClinVar).
"""
- 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 iterate_known_muts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def iterate_known_muts(self):
from models import Mutation
from tqdm import tqdm
for value in tqdm(self.values(), total=len(self.db)):
- 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 parse_significance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_significance(self, significance):
significance = significance.lower()
if significance in self.significance_map:
- 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 is_swissprot_isoform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def is_swissprot_isoform(self):
if self.external_references:
for entry in self.external_references.uniprot_entries:
if entry.reviewed:
return True
- 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 load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load(self, path=None, update=False, **kwargs):
"""Load, parse and insert mutations from given path.
If update is True, old mutations will be updated and new added.
Essential difference when using update is that 'update' prevents
- 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 load_sites
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_sites(self, path=None, **filters):
if not path:
path = self.default_path
- 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 sequence_logo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sequence_logo(
pwm_or_seq, path: Path = None, width=369, height=149, dpi=72, legend=False,
renumerate=True, title: str = None, **kwargs
):
"""Generate a sequence logo from Position Weight Matrix (pwm)
- 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"
Further reading
Function parser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parser(line):
kinase_name, gene_name = line
protein = get_preferred_gene_isoform(gene_name)
if not protein:
- 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 look_after_duplicates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def look_after_duplicates(self, mutation_id, mutations_details, values):
"""To prevent inclusion of duplicate data use this function to check for duplicates
before adding any data to mutations_details insertion list.
For example, assuming that clinvar_mutations is an insertion list use:
- 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 generic_aggregator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def generic_aggregator(attribute, flatten=False, is_callable=False):
def aggregator(self, data_filter=lambda x: x):
data = data_filter(self.data)
aggregated = [
- 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 validate_address
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_address(self, key, address):
if '//' in address or address.endswith('/') or address.startswith('/'):
raise ValidationError('Address cannot contain neither consecutive nor trailing slashes')
pages = Page.query.filter_by(address=address).all()
if pages:
- 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 extract_targets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_targets(drugs: List[Dict]) -> List[Dict]:
targets = []
for drug in drugs:
for target in drug.get('targets', []):
for polypeptide in target.get('polypeptides', []):
- 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 send_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def send_message(self):
go_to = request.form.get('after_success', '/')
redirection = redirect(go_to)
if not recaptcha.verify():
- 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 save_settings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_settings(self):
goto = request.form.get(
'goto',
url_for('ContentManagementSystem:settings')
)
- 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 association_table_super_factory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def association_table_super_factory(bind=None):
def make_association_table(fk1, fk2, index=False):
"""Create an association table basing on names of two given foreign keys.
- 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 __repr__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __repr__(self):
try:
properties = {}
- 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_hybrid_expression
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_hybrid_expression(sql_func):
def expression(parent_model, child_model, join=None):
"""
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 mysql_columns_to_update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mysql_columns_to_update(old_definitions: dict, new_definitions: dict) -> list:
columns_to_update = []
for column_name, new_definition in new_definitions.items():
- 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 mysql_extract_definitions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mysql_extract_definitions(table_definition: str) -> dict:
columns_definitions = {}
to_replace = {
r'TINYINT\(1\)': 'BOOL', # synonymous for MySQL and SQLAlchemy
- 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"