ihavalyova/DiAtomic

View on GitHub

Showing 129 of 135 total issues

Function _on_solve_button_clicked has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def _on_solve_button_clicked(self):

        diatomic = Diatomic(
            molecule=self.sel_isotopes,
            refj=self.refj,
Severity: Minor
Found in diatomic/gui.py - About 1 hr to fix

    Function solve has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def solve(self, ops, ypar=None, energy_range_index=None, energy_range_value=None):
            """A general function which solves the coupled system of Shcrodinger equations
    
            Args:
                energy_range_index (tuple, optional): Specifies a subset of
    Severity: Minor
    Found in diatomic/hamiltonian.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

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

            diag2 = (self.x[2:n] - self.x[1:n-1]) / 6.0
    Severity: Major
    Found in diatomic/interpolator.py and 1 other location - About 1 hr to fix
    diatomic/interpolator.py on lines 65..65

    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

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

            diag0 = (self.x[2:n] - self.x[0:n-2]) / 3.0
    Severity: Major
    Found in diatomic/interpolator.py and 1 other location - About 1 hr to fix
    diatomic/interpolator.py on lines 68..68

    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

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

            if self.state2.omega == 0 and self.state2.sigma < 0:
                sg2 = abs(self.state2.sigma)
    Severity: Major
    Found in diatomic/operator.py and 1 other location - About 1 hr to fix
    diatomic/operator.py on lines 289..290

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

    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 self.state1.omega == 0 and self.state1.sigma < 0:
                sg1 = abs(self.state1.sigma)
    Severity: Major
    Found in diatomic/operator.py and 1 other location - About 1 hr to fix
    diatomic/operator.py on lines 293..294

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

    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 calculate_matrix_elements(self, jrotn, par, iso):
    
            self.matrix[self.dd] = self.spin_orbit_interaction() * self.ygrid
    
            return self.matrix
    Severity: Major
    Found in diatomic/operator.py and 1 other location - About 1 hr to fix
    diatomic/operator.py on lines 794..798

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

    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 calculate_matrix_elements(self, jrotn, par, iso):
    
            self.matrix[self.dd] = self._spin_spin_interaction() * self.ygrid
    
            return self.matrix
    Severity: Major
    Found in diatomic/operator.py and 1 other location - About 1 hr to fix
    diatomic/operator.py on lines 103..107

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

    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

            rule_omegaj = \
                self._rule_sj_interaction(jrotn) and \
                _sqrt(jjrotn - (self.state1.omega * self.state2.omega))
    Severity: Major
    Found in diatomic/operator.py and 1 other location - About 1 hr to fix
    diatomic/operator.py on lines 261..262

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

    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

            rule_omegaj = self._rule_lj_interaction(jrotn) and \
                _sqrt(jjrotn - (self.state1.omega * self.state2.omega))
    Severity: Major
    Found in diatomic/operator.py and 1 other location - About 1 hr to fix
    diatomic/operator.py on lines 422..424

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

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

        def _compute_rot_factors(self, usymm, lsymm, uj, lj, uomega,
    Severity: Major
    Found in diatomic/spectrum.py - About 1 hr to fix

      Function __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
      Severity: Major
      Found in diatomic/hamiltonian.py - About 1 hr to fix

        Function _init_operator_dynamic_widget_lists has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def _init_operator_dynamic_widget_lists(self):
        
                self.operatorGridLayouts = []
                self.operatorTypeLabels = []
                self.operatorPairStateLabels = []
        Severity: Minor
        Found in diatomic/gui.py - About 1 hr to fix

          Function _on_show_radial_parameters_button_clicked has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def _on_show_radial_parameters_button_clicked(self, index):
          
                  # self._toggle_table_widget()
          
                  params = []
          Severity: Minor
          Found in diatomic/gui.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

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

                  diag2 = 1.0 / (self.x[2:n] - self.x[1:n-1])
          Severity: Major
          Found in diatomic/interpolator.py and 1 other location - About 1 hr to fix
          diatomic/interpolator.py on lines 78..78

          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

          Function _interpolate_dipole_moment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              def _interpolate_dipole_moment(self, igrid, dmfs):
          
                  # dipole_matrix = np.ones((self.H.nch, self.H.nch, igrid.shape[0]))
                  dipole_matrix = np.zeros((self.H.nch, self.H.nch, igrid.shape[0]))
          
          
          Severity: Minor
          Found in diatomic/spectrum.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 extract_terms_in_range has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def extract_terms_in_range(self, uenergy=None, lenergy=None, usymm=None,
          Severity: Major
          Found in diatomic/hamiltonian.py - About 1 hr to fix

            Function _compute_honl_london_factors has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def _compute_honl_london_factors(self, usymm, lsymm, uj, lj, uomega,
            Severity: Major
            Found in diatomic/spectrum.py - About 1 hr to fix

              Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
              Severity: Major
              Found in diatomic/operator.py - About 1 hr to fix

                Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, objs, pair_states, label, model='pointwise', rotc=0.0,
                Severity: Major
                Found in diatomic/operator.py - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language