BjornFJohansson/pydna

View on GitHub

Showing 140 of 219 total issues

Function ferguson_to_mu0 has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

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 __getitem__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    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 __getitem__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    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 pcr has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

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

    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

        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

          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 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          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

            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 __init__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            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 _findDNAConcentrations has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            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

            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

        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

          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

            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 _to_units has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            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 __contains__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                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 lcs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                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 wrapstring has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            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 add_feature has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                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
              Severity
              Category
              Status
              Source
              Language