KarrLab/wc_kb

View on GitHub

Showing 44 of 94 total issues

Function get_seq_and_start_codon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_seq_and_start_codon(self, table=1, cds=True):
        """ Get the 5' to 3' amino acid sequence and the start codon

        Args:
            table (:obj:`int`, optional): NCBI identifier for translation table
Severity: Minor
Found in wc_kb/eukaryote.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 get_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_value(self):
        """ SpeciesType property values are stored as strings, this function returns the value as the correct type. """

        if self.value == '':
            return None
Severity: Minor
Found in wc_kb/core.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_EviNExperiment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def _parse_EviNExperiment(self, metadataObjs):
        if hasattr(self, 'evidence'):
            for evidence in self.evidence:
                metadataObjs = evidence._append_metadata_entries(key=Evidence, metadataObjs=metadataObjs)
                if evidence.experiment is not None:
Severity: Minor
Found in wc_kb/core.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 gen_id has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def gen_id(species_type, compartment):
        """ Generate a Species' primary identifier

        Args:
            species_type (:obj:`object`): a `SpeciesType`, or its id
Severity: Minor
Found in wc_kb/core.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