BjornFJohansson/pydna

View on GitHub

Showing 219 of 219 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

Severity: Major
Found in scripts/experimental_gel2.py and 1 other location - About 2 wks to fix
scripts/experimental_gel.py on lines 0..236

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 1761.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

Severity: Major
Found in scripts/experimental_gel.py and 1 other location - About 2 wks to fix
scripts/experimental_gel2.py on lines 0..236

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 1761.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            for i in range(nlanes):
                bandlength = bandlengths[i]
                center = lane_centers[i]
                x = center - bandlength / 2.0
                for j in range(len(lanes[i])):
        Severity: Major
        Found in scripts/gel/gel_old.py and 1 other location - About 2 days to fix
        scripts/gel/gel2.py on lines 525..548

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 270.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                    for i in range(nlanes):
                        bandlength = bandlengths[i]
                        center = lane_centers[i]
                        x = center - bandlength / 2.0
                        for j in range(len(lanes[i])):
        Severity: Major
        Found in scripts/gel/gel2.py and 1 other location - About 2 days to fix
        scripts/gel/gel_old.py on lines 1091..1114

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 270.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            if N < N_lim3:
                # Ogston-Zimm
                L = contour_length(Nbp, b)
                Rg = radius_gyration(L, lp)
                D0 = free_solution(kB, T, eta, Rg)
        Severity: Major
        Found in scripts/gel/gel_old.py and 1 other location - About 1 day to fix
        scripts/gel/gel_old.py on lines 1573..1589

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 173.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                        if N < N_lim3:
                            # Ogston-Zimm
                            L = contour_length(Nbp, b)  # (m)
                            Rg = radius_gyration(L, lp)  # (m)
                            D0 = free_solution(kB, temperature, eta, Rg)  # (m^2/s)
        Severity: Major
        Found in scripts/gel/gel_old.py and 1 other location - About 1 day to fix
        scripts/gel/gel_old.py on lines 550..566

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 173.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  for l in range(len(DNAvals)):
                      not_nan = _np.logical_not(_np.isnan(ln_mu_LxT[l]))
                      if sum(not_nan) > 1:
                          # (enough points for linear regression)
                          gradient, intercept, r_value, p_value, std_err = _stats.linregress(Tvals[not_nan], ln_mu_LxT[l][not_nan])
              Severity: Major
              Found in scripts/gel/gel_old.py and 1 other location - About 7 hrs to fix
              scripts/gel/gel2.py on lines 279..289

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 121.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      for l in range(len(DNAspace_for_mu0)):
                          not_nan = _np.logical_not(_np.isnan(ln_mu_LxT[l]))
                          if sum(not_nan) > 1:
                              # (enough points for linear regression)
                              gradient, intercept, r_value, p_value, std_err = _stats.linregress(
              Severity: Major
              Found in scripts/gel/gel2.py and 1 other location - About 7 hrs to fix
              scripts/gel/gel_old.py on lines 915..923

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 121.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                              for i in range(nlanes):
                                  ctr = lane_centers[i]
                                  wx = wellx[i]
                                  wy = welly[i]
                                  ax1.fill_between(
                  Severity: Major
                  Found in scripts/gel/gel2.py and 1 other location - About 6 hrs to fix
                  scripts/gel/gel_old.py on lines 1079..1087

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 108.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      for i in range(nlanes):
                          ctr = lane_centers[i]
                          wx = wellx[i]
                          wy = welly[i]
                          ax1.fill_between(
                  Severity: Major
                  Found in scripts/gel/gel_old.py and 1 other location - About 6 hrs to fix
                  scripts/gel/gel2.py on lines 513..521

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 108.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language