ihavalyova/DiAtomic

View on GitHub
diatomic/optimizer.py

Summary

Maintainability
C
1 day
Test Coverage

File optimizer.py has 415 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

import io
from os.path import join as _join
import scipy as sp
import numpy as np

Severity: Minor
Found in diatomic/optimizer.py - About 5 hrs 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 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 _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

            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 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 _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

                    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 _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

                        There are no issues that match your filters.

                        Category
                        Status