BjornFJohansson/pydna

View on GitHub

Showing 140 of 219 total issues

File gel_old.py has 1496 lines of code (exceeds 250 allowed). Consider refactoring.
Open
  • Open
  • Confirmed
  • Invalid
  • Wontfix
Cancel

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# doctest: +NORMALIZE_WHITESPACE
# doctest: +SKIP

Severity: Major
Found in scripts/gel/gel_old.py - About 3 days to fix

    File dseq.py has 1427 lines of code (exceeds 250 allowed). Consider refactoring.
    Open
    • Open
    • Confirmed
    • Invalid
    • Wontfix
    Cancel

    #!/usr/bin/env python3
    # -*- coding: utf-8 -*-
    
    # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
    # This code is part of the Python-dna distribution and governed by its
    Severity: Major
    Found in src/pydna/dseq.py - About 3 days to fix

      File dseqrecord.py has 1063 lines of code (exceeds 250 allowed). Consider refactoring.
      Open
      • Open
      • Confirmed
      • Invalid
      • Wontfix
      Cancel

      #!/usr/bin/env python3
      # -*- coding: utf-8 -*-
      # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
      # This code is part of the Python-dna distribution and governed by its
      # license.  Please see the LICENSE.txt file that should have been included
      Severity: Major
      Found in src/pydna/dseqrecord.py - About 2 days to fix

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

            def run(
                self,
                field=5.0,  # V/cm
                temperature=295.15,  # K
                runtime=None,  # seconds
        Severity: Minor
        Found in scripts/gel/gel2.py - About 2 days 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

        File seqrecord.py has 562 lines of code (exceeds 250 allowed). Consider refactoring.
        Open
        • Open
        • Confirmed
        • Invalid
        • Wontfix
        Cancel

        #!/usr/bin/env python3
        # -*- coding: utf-8 -*-
        
        # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
        # This code is part of the Python-dna distribution and governed by its
        Severity: Major
        Found in src/pydna/seqrecord.py - About 1 day to fix

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

          def gelplot_imshow(
              distances,
              bandwidths,
              intensities,
              lanes,
          Severity: Minor
          Found in scripts/gel/gel_old.py - About 1 day 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

          File design.py has 536 lines of code (exceeds 250 allowed). Consider refactoring.
          Open
          • Open
          • Confirmed
          • Invalid
          • Wontfix
          Cancel

          #!/usr/bin/env python3
          # -*- coding: utf-8 -*-
          # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
          # This code is part of the Python-dna distribution and governed by its
          # license.  Please see the LICENSE.txt file that should have been included
          Severity: Major
          Found in src/pydna/design.py - About 1 day to fix

            File _thermodynamic_data.py has 515 lines of code (exceeds 250 allowed). Consider refactoring.
            Open
            • Open
            • Confirmed
            • Invalid
            • Wontfix
            Cancel

            #!/usr/bin/env python3
            # -*- coding: utf-8 -*-
            # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
            # This code is part of the pydna distribution and governed by its
            # license.  Please see the LICENSE.txt file that should have been included
            Severity: Major
            Found in src/pydna/_thermodynamic_data.py - About 1 day to fix

              File gel2.py has 495 lines of code (exceeds 250 allowed). Consider refactoring.
              Open
              • Open
              • Confirmed
              • Invalid
              • Wontfix
              Cancel

              #!/usr/bin/env python3
              # -*- coding: utf-8 -*-
              
              import matplotlib
              
              
              Severity: Minor
              Found in scripts/gel/gel2.py - About 7 hrs to fix

                File utils.py has 463 lines of code (exceeds 250 allowed). Consider refactoring.
                Open
                • Open
                • Confirmed
                • Invalid
                • Wontfix
                Cancel

                #!/usr/bin/env python3
                # -*- coding: utf-8 -*-
                # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
                # This code is part of the Python-dna distribution and governed by its
                # license.  Please see the LICENSE.txt file that should have been included
                Severity: Minor
                Found in src/pydna/utils.py - About 7 hrs to fix

                  Dseq has 47 functions (exceeds 20 allowed). Consider refactoring.
                  Open
                  • Open
                  • Confirmed
                  • Invalid
                  • Wontfix
                  Cancel

                  class Dseq(_Seq):
                      """Dseq holds information for a double stranded DNA fragment.
                  
                      Dseq also holds information describing the topology of
                      the DNA fragment (linear or circular).
                  Severity: Minor
                  Found in src/pydna/dseq.py - About 6 hrs to fix

                    Dseqrecord has 47 functions (exceeds 20 allowed). Consider refactoring.
                    Open
                    • Open
                    • Confirmed
                    • Invalid
                    • Wontfix
                    Cancel

                    class Dseqrecord(_SeqRecord):
                        """Dseqrecord is a double stranded version of the Biopython SeqRecord [#]_ class.
                        The Dseqrecord object holds a Dseq object describing the sequence.
                        Additionally, Dseqrecord hold meta information about the sequence in the
                        from of a list of SeqFeatures, in the same way as the SeqRecord does.
                    Severity: Minor
                    Found in src/pydna/dseqrecord.py - About 6 hrs to fix

                      File amplify.py has 427 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open
                      • Open
                      • Confirmed
                      • Invalid
                      • Wontfix
                      Cancel

                      #!/usr/bin/env python3
                      # -*- coding: utf-8 -*-
                      # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
                      # This code is part of the Python-dna distribution and governed by its
                      # license.  Please see the LICENSE.txt file that should have been included
                      Severity: Minor
                      Found in src/pydna/amplify.py - About 6 hrs to fix

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

                            def run(
                                self,
                                till_len=0.75,  # percent of gel_len
                                till_time=None,  # hours
                                exposure=0.5,  # [0-1]
                        Severity: Minor
                        Found in scripts/gel/gel_old.py - About 5 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 __init__ has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                        Open
                        • Open
                        • Confirmed
                        • Invalid
                        • Wontfix
                        Cancel

                            def __init__(
                                self,
                                watson,
                                crick=None,
                                ovhg=None,
                        Severity: Minor
                        Found in src/pydna/dseq.py - About 5 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

                        SeqRecord has 40 functions (exceeds 20 allowed). Consider refactoring.
                        Open
                        • Open
                        • Confirmed
                        • Invalid
                        • Wontfix
                        Cancel

                        class SeqRecord(_SeqRecord):
                            """
                            A subclass of the Biopython SeqRecord class.
                        
                            Has a number of extra methods and uses
                        Severity: Minor
                        Found in src/pydna/seqrecord.py - About 5 hrs to fix

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

                          def eq(*args, **kwargs):
                              """Compare two or more DNA sequences for equality.
                          
                              Compares two or more DNA sequences for equality i.e. if they
                              represent the same double stranded DNA molecule.
                          Severity: Minor
                          Found in src/pydna/utils.py - About 5 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

                          File assembly.py has 380 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open
                          • Open
                          • Confirmed
                          • Invalid
                          • Wontfix
                          Cancel

                          #!/usr/bin/env python3
                          # -*- coding: utf-8 -*-
                          # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
                          # This code is part of the Python-dna distribution and governed by its
                          # license.  Please see the LICENSE.txt file that should have been included
                          Severity: Minor
                          Found in src/pydna/assembly.py - About 5 hrs to fix

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

                                def assemble_circular(self, length_bound=None):
                                    cps = {}  # circular assembly
                                    cpsrc = {}
                                    cpaths = sorted(_nx.simple_cycles(self.G, length_bound=length_bound), key=len)
                                    cpaths_sorted = []
                            Severity: Minor
                            Found in src/pydna/assembly.py - About 5 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 map_trace_files has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                            Open
                            • Open
                            • Confirmed
                            • Invalid
                            • Wontfix
                            Cancel

                                def map_trace_files(self, pth, limit=25):  # TODO allow path-like objects
                                    import glob
                            
                                    traces = []
                                    for name in glob.glob(pth):
                            Severity: Minor
                            Found in src/pydna/dseqrecord.py - About 5 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

                            File genbankfixer.py has 377 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open
                            • Open
                            • Confirmed
                            • Invalid
                            • Wontfix
                            Cancel

                            #!/usr/bin/env python3
                            # -*- coding: utf-8 -*-
                            # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
                            # This code is part of the pydna distribution and governed by its
                            # license.  Please see the LICENSE.txt file that should have been included
                            Severity: Minor
                            Found in src/pydna/genbankfixer.py - About 5 hrs to fix

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

                              def guess_alphabet(sequence):
                                  """
                                  guess_alphabet(sequence)
                              
                                  returns an apropriate Biopython alphabet based on the content of the sequence.
                              Severity: Minor
                              Found in scripts/guess_alphabet.py - About 3 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 assemble_linear has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                              Open
                              • Open
                              • Confirmed
                              • Invalid
                              • Wontfix
                              Cancel

                                  def assemble_linear(self, start=None, end=None, max_nodes=None):
                                      G = _nx.MultiDiGraph(self.G)
                              
                                      G.add_nodes_from(["begin", "begin_rc", "end", "end_rc"], length=0)
                              
                              
                              Severity: Minor
                              Found in src/pydna/assembly.py - About 3 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 embl_gb_fasta has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                              Open
                              • Open
                              • Confirmed
                              • Invalid
                              • Wontfix
                              Cancel

                              def embl_gb_fasta(text, ds, path=None):
                              
                                  chunks = extract_from_text(text)
                                  result_list = []
                              
                              
                              Severity: Minor
                              Found in src/pydna/parsers.py - About 3 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 ligate has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                              Open
                              • Open
                              • Confirmed
                              • Invalid
                              • Wontfix
                              Cancel

                              def ligate(fragments: list):
                                  """docstring."""
                                  G = _nx.DiGraph()
                                  G.add_nodes_from(["begin", "end"])
                                  fragments = fragments[:]
                              Severity: Minor
                              Found in src/pydna/ligate.py - About 3 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 primer_design has a Cognitive Complexity of 25 (exceeds 5 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):
                                  """This function designs a forward primer and a reverse primer for PCR amplification
                                  of a given template sequence.
                              
                                  The template argument is a Dseqrecord object or equivalent containing the template sequence.
                              Severity: Minor
                              Found in src/pydna/design.py - About 3 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 run has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open
                              • Open
                              • Confirmed
                              • Invalid
                              • Wontfix
                              Cancel

                                  def run(
                                      self,
                                      till_len=0.75,  # percent of gel_len
                                      till_time=None,  # hours
                                      exposure=0.5,  # [0-1]
                              Severity: Major
                              Found in scripts/gel/gel_old.py - About 3 hrs to fix

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

                                    def __repr__(self):
                                        """Returns a representation of the sequence, truncated if
                                        longer than 30 bp"""
                                
                                        if len(self) > Dseq.trunc:
                                Severity: Minor
                                Found in src/pydna/dseq.py - About 3 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 fuse_by_pcr has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open
                                • Open
                                • Confirmed
                                • Invalid
                                • Wontfix
                                Cancel

                                def fuse_by_pcr(fragments, limit=15):
                                    """docstring."""
                                
                                    def anneal(x, y, limit=limit):
                                        """docstring."""
                                Severity: Minor
                                Found in src/pydna/fusionpcr.py - About 3 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 tm_default has 27 arguments (exceeds 4 allowed). Consider refactoring.
                                Open
                                • Open
                                • Confirmed
                                • Invalid
                                • Wontfix
                                Cancel

                                def tm_default(
                                Severity: Major
                                Found in src/pydna/tm.py - About 3 hrs to fix

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

                                      def products(self):
                                          if self._products:
                                              return self._products
                                  
                                          self._products = []
                                  Severity: Minor
                                  Found in src/pydna/amplify.py - About 3 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 assembly_fragments has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                  Open
                                  • Open
                                  • Confirmed
                                  • Invalid
                                  • Wontfix
                                  Cancel

                                  def assembly_fragments(f, overlap=35, maxlink=40):
                                      """This function return a list of :mod:`pydna.amplicon.Amplicon` objects where
                                      primers have been modified with tails so that the fragments can be fused in
                                      the order they appear in the list by for example Gibson assembly or homologous
                                      recombination.
                                  Severity: Minor
                                  Found in src/pydna/design.py - About 3 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 gel has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                                  Open
                                  • Open
                                  • Confirmed
                                  • Invalid
                                  • Wontfix
                                  Cancel

                                  def gel(samples=None, gel_length=600, margin=50, interpolator=interpolator(mwstd=_mwstd)):
                                      import numpy as np
                                      from PIL import Image as Image
                                      from PIL import ImageDraw as ImageDraw
                                  
                                  
                                  Severity: Minor
                                  Found in src/pydna/gel.py - About 3 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 all_simple_paths_edges has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                                  Open
                                  • Open
                                  • Confirmed
                                  • Invalid
                                  • Wontfix
                                  Cancel

                                  def all_simple_paths_edges(G, source, target, cutoff=None, data=False):
                                      if data == True:
                                          edge_data = lambda u, v, n, E, I: (u, v, dict([E[n][I[n]]]))
                                      else:
                                          edge_data = lambda u, v, n, E, I: (u, v)
                                  Severity: Minor
                                  Found in scripts/_simple_paths8.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 run has 22 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open
                                  • Open
                                  • Confirmed
                                  • Invalid
                                  • Wontfix
                                  Cancel

                                      def run(
                                  Severity: Major
                                  Found in scripts/gel/gel2.py - About 2 hrs to fix

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

                                    def toGB(jseq):
                                        "parses json jseq data and prints out ApE compatible genbank"
                                    
                                        # construct the LOCUS header string
                                        #  LOCUS format:
                                    Severity: Minor
                                    Found in src/pydna/genbankfixer.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 SmallestRotation has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                    Open
                                    • Open
                                    • Confirmed
                                    • Invalid
                                    • Wontfix
                                    Cancel

                                    def SmallestRotation(s):
                                        """Find the rotation of s that is smallest in lexicographic order.
                                        Duval 1983 describes how to modify his algorithm to do so but I think
                                        it's cleaner and more general to work from the ChenFoxLyndon output."""
                                    
                                    
                                    Severity: Minor
                                    Found in scripts/LongestCommonSubstring/experiments.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 add_feature has a Cognitive Complexity of 19 (exceeds 5 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):
                                            """Add a feature of type misc to the feature list of the sequence.
                                    
                                            Parameters
                                            ----------
                                    Severity: Minor
                                    Found in src/pydna/seqrecord.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 cutsite_is_valid has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                    Open
                                    • Open
                                    • Confirmed
                                    • Invalid
                                    • Wontfix
                                    Cancel

                                        def cutsite_is_valid(self, cutsite):
                                            """Returns False if:
                                            - Cut positions fall outside the sequence (could be moved to Biopython)
                                            - Overhang is not double stranded
                                            - Recognition site is not double stranded or is outside the sequence
                                    Severity: Minor
                                    Found in src/pydna/dseq.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 all_circular_paths_edges has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                    Open
                                    • Open
                                    • Confirmed
                                    • Invalid
                                    • Wontfix
                                    Cancel

                                    def all_circular_paths_edges(G):
                                        for path in sorted(_nx.simple_cycles(G), key=len, reverse=True):
                                            edges = list(zip(path, path[1:] + [path[0]]))
                                            N = []
                                            for u, v in edges:
                                    Severity: Minor
                                    Found in scripts/_simple_paths8.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

                                    File __init__.py has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open
                                    • Open
                                    • Confirmed
                                    • Invalid
                                    • Wontfix
                                    Cancel

                                    #!/usr/bin/env python3
                                    # -*- coding: utf-8 -*-
                                    # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
                                    # This code is part of the Python-dna distribution and governed by its
                                    # license.  Please see the LICENSE.txt file that should have been included
                                    Severity: Minor
                                    Found in src/pydna/__init__.py - About 2 hrs to fix

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

                                          def run(
                                      Severity: Major
                                      Found in scripts/gel/gel_old.py - About 2 hrs to fix

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

                                        def gelplot_imshow(
                                        Severity: Major
                                        Found in scripts/gel/gel_old.py - About 2 hrs to fix

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

                                          def tm_dbd(
                                          Severity: Major
                                          Found in src/pydna/tm.py - About 2 hrs to fix

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

                                            def _all_simple_paths_graph(G, source, target, cutoff=None):
                                                if source not in G:
                                                    raise _nx.NetworkXError("source node %s not in graph" % source)
                                                if target not in G:
                                                    raise _nx.NetworkXError("target node %s not in graph" % source)
                                            Severity: Minor
                                            Found in scripts/_simple_paths8.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 T4 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                            Open
                                            • Open
                                            • Confirmed
                                            • Invalid
                                            • Wontfix
                                            Cancel

                                                def T4(self, nucleotides=None):
                                                    """Fill in five prime protruding ends and chewing back
                                                    three prime protruding ends by a DNA polymerase providing both
                                                    5'-3' DNA polymerase activity and 3'-5' nuclease acitivty
                                                    (such as T4 DNA polymerase). This can be done in presence of any
                                            Severity: Minor
                                            Found in src/pydna/dseq.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 __init__ has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                            Open
                                            • Open
                                            • Confirmed
                                            • Invalid
                                            • Wontfix
                                            Cancel

                                                def __init__(
                                                    self,
                                                    record,
                                                    *args,
                                                    # linear=None,
                                            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 run has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open
                                            • Open
                                            • Confirmed
                                            • Invalid
                                            • Wontfix
                                            Cancel

                                                def run(
                                                    self,
                                                    field=5.0,  # V/cm
                                                    temperature=295.15,  # K
                                                    runtime=None,  # seconds
                                            Severity: Major
                                            Found in scripts/gel/gel2.py - About 2 hrs to fix

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

                                              def gelplot_imshow(
                                                  distances,
                                                  bandwidths,
                                                  intensities,
                                                  lanes,
                                              Severity: Major
                                              Found in scripts/gel/gel_old.py - About 2 hrs to fix

                                                File tm.py has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                                                Open
                                                • Open
                                                • Confirmed
                                                • Invalid
                                                • Wontfix
                                                Cancel

                                                #!/usr/bin/env python3
                                                # -*- coding: utf-8 -*-
                                                # Copyright 2013-2023 by Björn Johansson.  All rights reserved.
                                                # This code is part of the Python-dna distribution and governed by its
                                                # license.  Please see the LICENSE.txt file that should have been included
                                                Severity: Minor
                                                Found in src/pydna/tm.py - About 2 hrs to fix
                                                  Severity
                                                  Category