reimandlab/Visualistion-Framework-for-Genome-Mutations

View on GitHub

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).
        """

Severity: Minor
Found in website/stats/stats.py - About 25 mins to fix

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)):
Severity: Minor
Found in website/genomic_mappings.py - About 25 mins to fix

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:
Severity: Minor
Found in website/imports/mutations/clinvar.py - About 25 mins to fix

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
Severity: Minor
Found in website/models/bio/protein.py - About 25 mins to fix

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
Severity: Minor
Found in website/imports/mutations/mutation_importer/__init__.py - About 25 mins to fix

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

Severity: Minor
Found in website/imports/sites/uniprot/importer.py - About 25 mins to fix

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)
Severity: Minor
Found in website/helpers/plots.py - About 25 mins to fix

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

Severity: Minor
Found in website/views/search.py - About 25 mins to fix

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:
Severity: Minor
Found in website/imports/protein_data.py - About 25 mins to fix

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:
Severity: Minor
Found in website/imports/mutations/mutation_importer/__init__.py - About 25 mins to fix

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 = [
Severity: Minor
Found in website/helpers/models.py - About 25 mins to fix

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:
Severity: Minor
Found in website/models/cms.py - About 25 mins to fix

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', []):
Severity: Minor
Found in website/imports/drugbank.py - About 25 mins to fix

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():
Severity: Minor
Found in website/views/cms.py - About 25 mins to fix

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')
        )
Severity: Minor
Found in website/views/cms.py - About 25 mins to fix

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.

Severity: Minor
Found in website/helpers/models.py - About 25 mins to fix

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 = {}

Severity: Minor
Found in website/models/model.py - About 25 mins to fix

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:
Severity: Minor
Found in website/database/__init__.py - About 25 mins to fix

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():

Severity: Minor
Found in website/database/migrate.py - About 25 mins to fix

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
Severity: Minor
Found in website/database/migrate.py - About 25 mins to fix

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

Severity
Category
Status
Source
Language