BjornFJohansson/pydna

View on GitHub

Showing 140 of 219 total issues

Function shift_location has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

def shift_location(original_location, shift, lim):
    """docstring."""
    newparts = []
    strand = original_location.strand

Severity: Minor
Found in src/pydna/utils.py - About 2 hrs 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 write has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def write(self, filename=None, f="gb"):
        """Writes the Dseqrecord to a file using the format f, which must
        be a format supported by Biopython SeqIO for writing [#]_. Default
        is "gb" which is short for Genbank. Note that Biopython SeqIO reads
        more formats than it writes.
Severity: Minor
Found in src/pydna/dseqrecord.py - About 2 hrs 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 synced has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def synced(self, ref, limit=25):
        """This method returns a new circular sequence (Dseqrecord object), which has been rotated
        in such a way that there is maximum overlap between the sequence and
        ref, which may be a string, Biopython Seq, SeqRecord object or
        another Dseqrecord object.
Severity: Minor
Found in src/pydna/dseqrecord.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

Function download_text has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

def download_text(url):
    cached = False
    refresh = False
    cache = _shelve.open(
        _os.path.join(_os.environ["pydna_data_dir"], "web"),
Severity: Minor
Found in scripts/memo/download_old.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

Function toJSON has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

def toJSON(gbkstring):
    parsed = multipleGB.parseString(gbkstring)

    jseqlist = []

Severity: Minor
Found in src/pydna/genbankfixer.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

Function assign_quantitiesB has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

def assign_quantitiesB(samples, maxdef=Q_(150, "ng")):
    """
    Assigns quantities (masses in nanograms) to the DNA fragments without
    corresponding quantity assuming a linear relationship between the DNA
    length (in basepairs) and its mass. As if the fragments originated in
Severity: Minor
Found in scripts/gel/gel_old.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

Function __init__ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def __init__(self, frags=None, limit=25, algorithm=common_sub_strings):
        # Fragments is a string subclass with some extra properties
        # The order of the fragments has significance
        fragments = []
        for f in frags:
Severity: Minor
Found in src/pydna/assembly.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

Function __getitem__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def __getitem__(self, sl):
        """docstring."""
        answer = Dseqrecord(_copy.copy(self))
        answer.seq = self.seq.__getitem__(sl)
        # answer.seq.alphabet = self.seq.alphabet
Severity: Minor
Found in src/pydna/dseqrecord.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

Function apply_cut has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def apply_cut(self, left_cut, right_cut):
        dseq = self.seq.apply_cut(left_cut, right_cut)
        # TODO: maybe remove depending on https://github.com/BjornFJohansson/pydna/issues/161

        if left_cut == right_cut:
Severity: Minor
Found in src/pydna/dseqrecord.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

Function ferguson_to_mu0 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

def ferguson_to_mu0(
    field,
    Tvals,
    DNAvals,
    dataset,
Severity: Minor
Found in scripts/gel/gel_old.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

Function toGB has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

def toGB(jseqs):
    "parses json jseq data and prints out ApE compatible genbank"

    # take first jseq from parsed list
    if type(jseqs) == type([]):
Severity: Minor
Found in scripts/BioJSON-master/genbank_writer.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

Function __getitem__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def __getitem__(self, sl):
        """Returns a subsequence. This method is used by the slice notation"""

        if not self.circular:
            x = len(self.crick) - self.ovhg - len(self.watson)
Severity: Minor
Found in src/pydna/dseq.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

Function __getitem__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def __getitem__(self, i):
        """Save indices of accessed items."""
        if isinstance(i, slice):
            result = self.__class__(self.data[i])
            for ind in range(i.start, i.stop, i.step or 1):
Severity: Minor
Found in src/pydna/myprimers.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

Function pcr has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

def pcr(*args, **kwargs):
    """pcr is a convenience function for the Anneal class to simplify its
    usage, especially from the command line. If more than one or no PCR
    product is formed, a ValueError is raised.

Severity: Minor
Found in src/pydna/amplify.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

Function __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

    def __init__(
Severity: Major
Found in scripts/gel/gel2.py - About 1 hr to fix

    Function __init__ has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open
    • Open
    • Confirmed
    • Invalid
    • Wontfix
    Cancel

        def __init__(
            self,
            samples,  # list of lists of Dseqrecords
            names=None,
            percentgel=Q_(1.0, "(g/(100 mL))*100"),  # agar/buffer
    Severity: Minor
    Found in scripts/gel/gel_old.py - About 1 hr to fix

      Function __add__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

          def __add__(self, other):
              if hasattr(other, "seq") and hasattr(other.seq, "watson"):
                  other = _copy.deepcopy(other)
                  other_five_prime = other.seq.five_prime_end()
                  if other_five_prime[0] == "5'":
      Severity: Minor
      Found in src/pydna/dseqrecord.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

      Function __init__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

          def __init__(self, primers, template, limit=13, **kwargs):
              r"""The Anneal class has to be initiated with at least an iterable of
              primers and a template.
      
      
      
      Severity: Minor
      Found in src/pydna/amplify.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

      Function __init__ has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

          def __init__(
      Severity: Major
      Found in scripts/gel/gel_old.py - About 1 hr to fix

        Function open has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

            def open(self, seq_to_open):
                """Open a sequence for editing in an external (DNA) editor.
        
                Parameters
                ----------
        Severity: Minor
        Found in src/pydna/editor.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

        Function _findDNAConcentrations has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

            def _findDNAConcentrations(self, background):
                """Determines where in the concentration of DNA in every part of the gel"""
        
                length = len(self.lanes[0])
        
        
        Severity: Minor
        Found in scripts/experimental_gel2.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

        Function _findDNAConcentrations has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

            def _findDNAConcentrations(self, background):
                """Determines where in the concentration of DNA in every part of the gel"""
        
                length = len(self.lanes[0])
        
        
        Severity: Minor
        Found in scripts/experimental_gel.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

        Function vWBRfit has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

        def vWBRfit(
        Severity: Major
        Found in scripts/gel/gel_old.py - About 1 hr to fix

          Function ferguson_to_mu0 has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          def ferguson_to_mu0(
          Severity: Major
          Found in scripts/gel/gel_old.py - About 1 hr to fix

            Function wrapstring has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

            def wrapstring(str_, rowstart, rowend, padfirst=True):
                """
                wraps the provided string in lines of length rowend-rowstart
                and padded on the left by rowstart.
                -> if padfirst is false the first line is not padded
            Severity: Minor
            Found in scripts/BioJSON-master/genbank_writer.py - About 55 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 lcs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                def lcs(self, other, *args, limit=25, **kwargs):
                    """Return the longest common substring between the sequence.
            
                    and another sequence (other). The other sequence can be a string,
                    Seq, SeqRecord, Dseq or DseqRecord.
            Severity: Minor
            Found in src/pydna/seqrecord.py - About 55 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 __contains__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                def __contains__(self, other):
                    if other.lower() in str(self.seq).lower():
                        return True
                    else:
                        s = self.seq.watson.replace(" ", "")
            Severity: Minor
            Found in src/pydna/dseqrecord.py - About 55 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 _to_units has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

            def _to_units(quantity, units, var_name=None):
                """Asserts that the quantity has the proper dimensions
                (inferred from the default units) if the quantity is an instance of
                pint.unit.Quantity or assigns the default units if it's not.
                """
            Severity: Minor
            Found in scripts/gel/gel_old.py - About 55 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 wrapstring has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

            def wrapstring(str_, rowstart, rowend, padfirst=True):
                """
                wraps the provided string in lines of length rowend-rowstart
                and padded on the left by rowstart.
                -> if padfirst is false the first line is not padded
            Severity: Minor
            Found in src/pydna/genbankfixer.py - About 55 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 from_SeqRecord has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

                def from_SeqRecord(cls, record, *args, item="accession", start=None, stop=None, strand=1, **kwargs):
            Severity: Major
            Found in src/pydna/genbankrecord.py - About 50 mins to fix

              Function from_string has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

                  def from_string(
              Severity: Major
              Found in src/pydna/genbankrecord.py - About 50 mins to fix

                Function add_feature has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

                    def add_feature(self, x=None, y=None, seq=None, type_="misc", strand=1, *args, **kwargs):
                Severity: Major
                Found in src/pydna/seqrecord.py - About 50 mins to fix

                  Function size_to_mobility has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open
                  • Open
                  • Confirmed
                  • Invalid
                  • Wontfix
                  Cancel

                  def size_to_mobility(
                  Severity: Major
                  Found in scripts/gel/gel_old.py - About 50 mins to fix

                    Function primer_design has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                    def primer_design(template, fp=None, rp=None, limit=13, target_tm=55.0, tm_func=_tm_default, **kwargs):
                    Severity: Major
                    Found in src/pydna/design.py - About 50 mins to fix

                      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                          def __init__(self, record, *args, item="accession", start=None, stop=None, strand=1, **kwargs):
                      Severity: Major
                      Found in src/pydna/genbankrecord.py - About 50 mins to fix

                        Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open
                        • Open
                        • Confirmed
                        • Invalid
                        • Wontfix
                        Cancel

                            def __init__(
                        Severity: Major
                        Found in src/pydna/dseqrecord.py - About 50 mins to fix

                          Function add_feature has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open
                          • Open
                          • Confirmed
                          • Invalid
                          • Wontfix
                          Cancel

                              def add_feature(self, x=None, y=None, seq=None, type_="misc", strand=1, *args, **kwargs):
                          Severity: Major
                          Found in src/pydna/dseqrecord.py - About 50 mins to fix

                            Avoid deeply nested control flow statements.
                            Open
                            • Open
                            • Confirmed
                            • Invalid
                            • Wontfix
                            Cancel

                                                    if not forwdYstop:
                                                        distYfor = Q_(pxlYfor, "px") / res
                                                        forYI = Gaussian(distYfor, maxI, distYmid, std_dev)
                                                        rgb_arr[pxlYfor, from_x:to_x] += forYI
                                                        pxlYfor += 1
                            Severity: Major
                            Found in scripts/gel/gel2.py - About 45 mins to fix

                              Function list_features has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open
                              • Open
                              • Confirmed
                              • Invalid
                              • Wontfix
                              Cancel

                                  def list_features(self):
                                      """Print ASCII table with all features.
                              
                                      Examples
                                      --------
                              Severity: Minor
                              Found in src/pydna/seqrecord.py - About 45 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 from_string has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open
                              • Open
                              • Confirmed
                              • Invalid
                              • Wontfix
                              Cancel

                                  def from_string(
                              Severity: Minor
                              Found in src/pydna/dseqrecord.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open
                                • Open
                                • Confirmed
                                • Invalid
                                • Wontfix
                                Cancel

                                                    if forYI <= Itol or pxlYfor == pxl_y:
                                                        forwdYstop = True
                                    # Background color
                                    if noise is None or noise <= 0:
                                Severity: Major
                                Found in scripts/gel/gel_old.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open
                                  • Open
                                  • Confirmed
                                  • Invalid
                                  • Wontfix
                                  Cancel

                                                      if k in [
                                                          "ApEinfo_label",
                                                          "ApEinfo_fwdcolor",
                                                          "ApEinfo_revcolor",
                                                          "label",
                                  Severity: Major
                                  Found in src/pydna/genbankfixer.py - About 45 mins to fix

                                    Function looped has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                    Open
                                    • Open
                                    • Confirmed
                                    • Invalid
                                    • Wontfix
                                    Cancel

                                        def looped(self):
                                            """
                                            Circular version of the Dseqrecord object.
                                    
                                            The underlying linear Dseq object has to have compatible ends.
                                    Severity: Minor
                                    Found in src/pydna/dseqrecord.py - About 45 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

                                    Avoid deeply nested control flow statements.
                                    Open
                                    • Open
                                    • Confirmed
                                    • Invalid
                                    • Wontfix
                                    Cancel

                                                        if bckYI <= Itol or pxlYbck == -1:
                                                            bckwdYstop = True
                                                    if not forwdYstop:
                                    Severity: Major
                                    Found in scripts/gel/gel_old.py - About 45 mins to fix

                                      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open
                                      • Open
                                      • Confirmed
                                      • Invalid
                                      • Wontfix
                                      Cancel

                                          def __init__(
                                      Severity: Minor
                                      Found in src/pydna/dseq.py - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open
                                        • Open
                                        • Confirmed
                                        • Invalid
                                        • Wontfix
                                        Cancel

                                                                if f.location.start > len(ct) and f.location.end > len(ct):
                                                                    f.location += -len(ct)
                                                                elif f.location.end > len(ct):
                                                                    f.location = _CompoundLocation(
                                                                        (
                                        Severity: Major
                                        Found in src/pydna/assembly.py - About 45 mins to fix

                                          Function nucleotide has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                          Open
                                          • Open
                                          • Confirmed
                                          • Invalid
                                          • Wontfix
                                          Cancel

                                              def nucleotide(self, item: str, seq_start=None, seq_stop=None, strand=1):
                                                  """This method downloads a genbank nuclotide record from genbank. This method is
                                                  cached by default. This can be controlled by editing the **pydna_cached_funcs** environment
                                                  variable. The best way to do this permanently is to edit the edit the
                                                  `pydna.ini` file. See the documentation of :func:`pydna.open_config_folder`
                                          Severity: Minor
                                          Found in src/pydna/genbank.py - About 45 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 Zimm_g has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open
                                          • Open
                                          • Confirmed
                                          • Invalid
                                          • Wontfix
                                          Cancel

                                          def Zimm_g(Nbp, DRouse, qeff, mu0, kB, T):
                                          Severity: Minor
                                          Found in scripts/gel/gel_old.py - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open
                                            • Open
                                            • Confirmed
                                            • Invalid
                                            • Wontfix
                                            Cancel

                                                                if pxlYbck < len(rgb_arr):
                                                                    rgb_arr[pxlYbck, from_x:to_x] += bckYI
                                                                pxlYbck -= 1
                                            Severity: Major
                                            Found in scripts/gel/gel_old.py - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open
                                              • Open
                                              • Confirmed
                                              • Invalid
                                              • Wontfix
                                              Cancel

                                                                      if not bckwdYstop:
                                                                          distYbck = Q_(pxlYbck, "px") / res
                                                                          bckYI = Gaussian(distYbck, maxI, distYmid, std_dev)
                                                                          if pxlYbck < len(rgb_arr):
                                                                              rgb_arr[pxlYbck, from_x:to_x] += bckYI
                                              Severity: Major
                                              Found in scripts/gel/gel2.py - About 45 mins to fix
                                                Severity
                                                Category