pombo-lab/gamtools

View on GitHub

Showing 23 of 473 total issues

Function comparison_from_operator has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def comparison_from_operator(operator, left, right):
    """
    Perform a comparison between left and right values in a QC
    conditions file.

Severity: Minor
Found in lib/gamtools/qc/pass_qc.py - About 35 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_conditions_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def parse_conditions_file(conditions_file, stats_df):
    """
    Iterate through lines of a conditions file and perform
    the indicated comparison for each line.

Severity: Minor
Found in lib/gamtools/qc/pass_qc.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 task_linkage_matrices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def task_linkage_matrices(self):
        """Task to calculate linkage matrices at specified resolutions"""

        # TODO: Allow specification of which chromosomes to generate matrices
        # for
Severity: Minor
Found in lib/gamtools/pipeline.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