ihavalyova/DiAtomic

View on GitHub

Showing 68 of 135 total issues

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

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

          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

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

                  def plot_radial_functions(self, ops, show=False, fname=None, subplots=None,
              Severity: Major
              Found in diatomic/hamiltonian.py - About 1 hr to fix

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

                    def optimize(self, ypar, yfixed, calculate_data, niter, derivative,
                Severity: Major
                Found in diatomic/optimizer.py - About 1 hr to fix

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

                      def __init__(self, objs=None, pair_states=None, label='', model='pointwise',
                  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

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

                            def set_constraints(self, uenr_range=None, lenr_range=None, lsymm=None,
                        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 _remove_layout has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def _remove_layout(self, layout):
                                    print(layout)
                                    for i in range(len(layout)):
                                        print(i, layout[i])
                                        temp_layout = layout[i]
                            Severity: Minor
                            Found in diatomic/gui.py - About 55 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 optimize_levels_by_svd_regular has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def optimize_levels_by_svd_regular(self, niter=1, derivative='n',
                            Severity: Major
                            Found in diatomic/optimizer.py - About 50 mins to fix

                              Function _write_fit_progress has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def _write_fit_progress(self, rank, sing_values, tol, ypar, dypar, yfixed):
                              Severity: Major
                              Found in diatomic/optimizer.py - About 50 mins to fix

                                Function plot_levels_hist has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def plot_levels_hist(self, data=None, show=False, fname=None,
                                Severity: Major
                                Found in diatomic/hamiltonian.py - About 50 mins to fix

                                  Function _get_dydp_elem has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def _get_dydp_elem(self, indices, sk, sk_grid, sk_coef, j, evecs_found):
                                  Severity: Major
                                  Found in diatomic/optimizer.py - About 50 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language