ericmjl/flu-gibson

View on GitHub

Showing 6 of 9 total issues

Function compute_intermediate_sequences has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def compute_intermediate_sequences(self):
        """
        Given the step in the protocol, computes the intermediate mutated
        coding sequences.

Severity: Minor
Found in FluGibson/nucleotide_converter.py - About 1 hr 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

Avoid deeply nested control flow statements.
Open

                for drxn in ['fw', 're']:
                    primer_data['part'] = n
                    primer_data['{0}_cloning_primer'.format(drxn)] =\
                        str(d['{0}_cloning_primer'.format(drxn)].seq)
                master_cloning_primers.append(primer_data)
Severity: Major
Found in examples/seal_h3n8/compute_primers.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if k in f:
                        segment = v
                backbone = plasmids['pDZ-{0}-split2'.format(segment)]
    Severity: Major
    Found in examples/seal_h3n8/compute_primers.py - About 45 mins to fix

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

          def get_part(self, part_name):
              """
              Returns the SeqRecord object whose id is the part_name.
      
              Paramters:
      Severity: Minor
      Found in FluGibson/primer_designer.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 compute_assembly_steps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def compute_assembly_steps(self):
              """
              Computes the mutation assembly steps based on the distance graph.
      
              The algorithm is as such:
      Severity: Minor
      Found in FluGibson/nucleotide_converter.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 compute_pcr_fragments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def compute_pcr_fragments(self):
              """
              Computes the PCR fragments to assemble, based on the protocol. The
              protocol currently specifies the codon positions to be mutated. For
              example, if we have:
      Severity: Minor
      Found in FluGibson/nucleotide_converter.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

      Severity
      Category
      Status
      Source
      Language