lucydot/effmass

View on GitHub
effmass/analysis.py

Summary

Maintainability
F
1 wk
Test Coverage
C
72%

File analysis.py has 710 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#! /usr/bin/env python3
"""
A module for analysing the data contained in a :class:`Segment` object.

Contains the :class:`Segment` class and methods for calculating various definitions of the effective mass.
Severity: Major
Found in effmass/analysis.py - About 1 day to fix

    Segment has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Segment:
        """Class for segments of the bandstructure. A Segment contains data for a
        particular region of reciprocal space and particular band.
    
        Attributes:
    Severity: Minor
    Found in effmass/analysis.py - About 3 hrs to fix

      Function _integrated_dos has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def _integrated_dos(self, DataVasp):
              """Returns slice of :attr:`effmass.DataVasp.integrated_dos` corresponding
              to the energy range of the segment.
      
              Args:
      Severity: Minor
      Found in effmass/analysis.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function _dos has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def _dos(self, DataVasp):
              """Returns slice of :attr:`effmass.DataVasp.dos` corresponding to the
              energy range of the segment.
      
              Args:
      Severity: Minor
      Found in effmass/analysis.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function weight_integration has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def weight_integration(self,
      Severity: Minor
      Found in effmass/analysis.py - About 35 mins to fix

        Function _weight_integrand has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _weight_integrand(self, k, fermi_level, temp, alpha, mass_bandedge):
        Severity: Minor
        Found in effmass/analysis.py - About 35 mins to fix

          Function _mass_integrand has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _mass_integrand(self, k, fermi_level, temp, alpha, mass_bandedge):
          Severity: Minor
          Found in effmass/analysis.py - About 35 mins to fix

            Function mass_integration has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def mass_integration(self,
            Severity: Minor
            Found in effmass/analysis.py - About 35 mins to fix

              Function fd has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def fd(self, k, fermi_level, temp, alpha, mass_bandedge):
              Severity: Minor
              Found in effmass/analysis.py - About 35 mins to fix

                Function optical_effmass_kane_dispersion has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def optical_effmass_kane_dispersion(self,
                Severity: Minor
                Found in effmass/analysis.py - About 35 mins to fix

                  Function optical_effmass_kane_dispersion has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def optical_effmass_kane_dispersion(self,
                                                          fermi_level=None,
                                                          temp=300,
                                                          alpha=None,
                                                          mass_bandedge=None,
                  Severity: Minor
                  Found in effmass/analysis.py - About 35 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function _solve_quadratic has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _solve_quadratic(a, b, c):
                      r"""
                      Solves quadratic equation of the form :math:`ax^2+bx+c=0` for multiple values of c.
                      If the determinant is more than 0 (two solutions), it always returns the larger root.
                  
                  
                  Severity: Minor
                  Found in effmass/analysis.py - About 35 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                      def _integrated_dos(self, DataVasp):
                          """Returns slice of :attr:`effmass.DataVasp.integrated_dos` corresponding
                          to the energy range of the segment.
                  
                          Args:
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 1 day to fix
                  effmass/analysis.py on lines 847..867

                  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 124.

                  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

                      def _dos(self, DataVasp):
                          """Returns slice of :attr:`effmass.DataVasp.dos` corresponding to the
                          energy range of the segment.
                  
                          Args:
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 1 day to fix
                  effmass/analysis.py on lines 869..888

                  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 124.

                  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

                          if truncate:
                              idx = self.explosion_index(polyfit_order=polyfit_order)
                              gradient, intercept = np.polyfit(self.dE_hartree[1:idx + 1],
                                                               transport_mass[1:idx + 1], 1)
                          else:
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 5 hrs to fix
                  effmass/analysis.py on lines 633..639

                  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 94.

                  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

                          if truncate:
                              idx = self.explosion_index(polyfit_order=polyfit_order)
                              gradient, intercept = np.polyfit(self.dE_hartree[1:idx + 1],
                                                               transport_mass[1:idx + 1], 1)
                          else:
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 5 hrs to fix
                  effmass/analysis.py on lines 662..668

                  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 94.

                  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 3 locations. Consider refactoring.
                  Open

                      def finite_difference_fit(self):
                          r"""
                          Calculates the curvature at the band edge using a finite difference method and then evaluates the corresponding quadratic dispersion along :attr:`~effmass.analysis.Segment.dk_bohr`.
                  
                          See :meth:`effmass.analysis.Segment.finite_difference_effmass`.
                  Severity: Major
                  Found in effmass/analysis.py and 2 other locations - About 4 hrs to fix
                  effmass/analysis.py on lines 771..786
                  effmass/analysis.py on lines 815..829

                  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 76.

                  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 3 locations. Consider refactoring.
                  Open

                      def five_point_leastsq_fit(self):
                          """Calculates the curvature effective mass using a parabolic least-
                          squares fit and then evaluates the corresponding parabolic dispersion
                          along :attr:`~effmass.analysis.Segment.dk_bohr`.
                  
                  
                  Severity: Major
                  Found in effmass/analysis.py and 2 other locations - About 4 hrs to fix
                  effmass/analysis.py on lines 719..734
                  effmass/analysis.py on lines 771..786

                  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 76.

                  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 3 locations. Consider refactoring.
                  Open

                      def weighted_leastsq_fit(self):
                          """Calculates the curvature effective mass usinhag a weighted least-
                          squares fit and then evaluates the corresponding parabolic dispersion
                          along :attr:`~effmass.analysis.Segment.dk_bohr`.
                  
                  
                  Severity: Major
                  Found in effmass/analysis.py and 2 other locations - About 4 hrs to fix
                  effmass/analysis.py on lines 719..734
                  effmass/analysis.py on lines 815..829

                  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 76.

                  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

                              return 1 - (1 / ((np.exp((self.energies[0] + self._kane_dispersion(
                                  k, alpha, mass_bandedge) - fermi_level) / (
                                      (boltzmann * temp) / q))) + 1))
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 3 hrs to fix
                  effmass/analysis.py on lines 322..324

                  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 65.

                  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

                              return (1 / ((np.exp((self.energies[0] + self._kane_dispersion(
                                  k, alpha, mass_bandedge) - fermi_level) / (
                                      (boltzmann * temp) / q))) + 1))
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 3 hrs to fix
                  effmass/analysis.py on lines 326..328

                  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 65.

                  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

                              probability = (1 / ((np.exp(
                                  (eigenvalue - fermi_level) / (((boltzmann * temp) / q))) + 1)))
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 1 hr to fix
                  effmass/analysis.py on lines 192..193

                  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 43.

                  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

                              probability = 1 - (1 / ((np.exp(
                                  (eigenvalue - fermi_level) / (((boltzmann * temp) / q))) + 1)))
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 1 hr to fix
                  effmass/analysis.py on lines 189..190

                  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 43.

                  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

                          if dk is None:
                              dk = np.linspace(self.dk_bohr[0], self.dk_bohr[-1], 100)
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 1 hr to fix
                  effmass/analysis.py on lines 608..609

                  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 39.

                  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

                          if dk is None:
                              dk = np.linspace(self.dk_bohr[0], self.dk_bohr[-1], 100)
                  Severity: Major
                  Found in effmass/analysis.py and 1 other location - About 1 hr to fix
                  effmass/analysis.py on lines 517..518

                  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 39.

                  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

                          self.energies = np.array(
                              [Data.energies[band, k] for k in kpoint_indices])  # in units eV
                  Severity: Minor
                  Found in effmass/analysis.py and 1 other location - About 30 mins to fix
                  effmass/analysis.py on lines 109..111

                  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 32.

                  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 Data.occupancy is not None:
                              self.occupancy = np.array(
                                  [Data.occupancy[band, k] for k in kpoint_indices])
                  Severity: Minor
                  Found in effmass/analysis.py and 1 other location - About 30 mins to fix
                  effmass/analysis.py on lines 104..105

                  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 32.

                  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

                  There are no issues that match your filters.

                  Category
                  Status