ihavalyova/DiAtomic

View on GitHub

Showing 68 of 135 total issues

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

    def _five_diagonal_matrix(self, a, b, c, k1=0, k2=1, k3=2):
Severity: Major
Found in diatomic/hamiltonian.py - About 50 mins to fix

    Function _rule_spin_spin_nondiag has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def _rule_spin_spin_nondiag(self):
    
            lambda_diff = self.state1._lambda - self.state2._lambda
            sigma_diff = self.state2.sigma - self.state1.sigma
    
    
    Severity: Minor
    Found in diatomic/operator.py - About 45 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_wavenumbers_by_svd has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def optimize_wavenumbers_by_svd(self, niter=1, derivative='n', tol=0.1,
    Severity: Minor
    Found in diatomic/optimizer.py - About 45 mins to fix

      Function _arange_levels has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _arange_levels(self, jrotn, par, iso, evalues, evecs, shift_enr=[0.0]):
      Severity: Minor
      Found in diatomic/hamiltonian.py - About 45 mins to fix

        Function plot_eigenfunctions has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def plot_eigenfunctions(self, nlevels, show=False, fname=None,
        Severity: Minor
        Found in diatomic/hamiltonian.py - About 45 mins to fix

          Function optimize_intensity_by_svd has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def optimize_intensity_by_svd(self, niter=1, derivative='n', tol=0.1,
          Severity: Minor
          Found in diatomic/optimizer.py - About 45 mins to fix

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

                def __init__(self, model, filep, rotc=0.0, shift_by=0.0, cfunc=None):
            Severity: Minor
            Found in diatomic/diatomic_data.py - About 45 mins to fix

              Function plot_hamiltonian_colormesh has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def plot_hamiltonian_colormesh(self, rows=None, cols=None, show=False,
              Severity: Minor
              Found in diatomic/hamiltonian.py - About 45 mins to fix

                Function _calculate_numerical_derivatives has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def _calculate_numerical_derivatives(self, ypar, yfixed, calculate_data,
                Severity: Minor
                Found in diatomic/optimizer.py - About 45 mins to fix

                  Function optimize_levels_by_svd has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def optimize_levels_by_svd(self, niter=1, derivative='n', tol=0.1,
                  Severity: Minor
                  Found in diatomic/optimizer.py - About 45 mins to fix

                    Function form_tridiag_matrix has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def form_tridiag_matrix(self, u, v, w, k1=-1, k2=0, k3=1):
                    Severity: Minor
                    Found in diatomic/interpolator.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if j not in memoize:
                                                  elem = self._get_dydp_elem(iprm[:4], sk, sk_grid,
                                                                            sk_coef, j, evecs_found)
                                              dydp[countj, prm] = elem[countj]
                      Severity: Major
                      Found in diatomic/optimizer.py - About 45 mins to fix

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

                            def calculate_partition_functions(self, Ia=0, Ib=0, T=296,
                        Severity: Minor
                        Found in diatomic/spectrum.py - About 35 mins to fix

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

                              def __init__(self, objs, eig_decomp='lapack', lapack_driver='evr',
                          Severity: Minor
                          Found in diatomic/hamiltonian.py - About 35 mins to fix

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

                                def calculate_Einstein_coefficients(self, wavens, dmfs=None, ninter=1000,
                            Severity: Minor
                            Found in diatomic/spectrum.py - About 35 mins to fix

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

                                  def __init__(self, npoints, rgrid, solver='sinc', alpha=0.0, rbar=0.0):
                              Severity: Minor
                              Found in diatomic/grid.py - About 35 mins to fix

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

                                    def _get_default_jrange(self, uterms, uj, lterms, lj):
                                Severity: Minor
                                Found in diatomic/spectrum.py - About 35 mins to fix

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

                                      def __init__(self, molecule, masses=None, niso=None, refj=None, ref_enr=None):
                                  Severity: Minor
                                  Found in diatomic/diatomic_data.py - About 35 mins to fix

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

                                        def _write_pointwise_data(self, fname, xpoints, ypoints, fixed):
                                    Severity: Minor
                                    Found in diatomic/optimizer.py - About 35 mins to fix

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

                                          def _calculate_wavenumber_with_observations(self, ulevels, llevels, wrange=None,
                                                                                      apply_rules=False):
                                      
                                              # id v J E p s iso lambda omega
                                              ulevels = ulevels[:, [0, -3, 2, 1, 3, -4, 4, -2, -1]]
                                      Severity: Minor
                                      Found in diatomic/spectrum.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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language