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

#!/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

    #!/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

      #!/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

            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

        #!/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

          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

          #!/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

            #!/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

              #!/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

                #!/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

                  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

                    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

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

                            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

                        Function run has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                        Open

                            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

                        SeqRecord has 40 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        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

                          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

                          #!/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 map_trace_files has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                            Open

                                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

                            Function assemble_circular has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                            Open

                                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

                            Severity
                            Category
                            Status
                            Source
                            Language