Showing 68 of 135 total issues
Function _five_diagonal_matrix
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _five_diagonal_matrix(self, a, b, c, k1=0, k2=1, k3=2):
Function _rule_spin_spin_nondiag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _rule_spin_spin_nondiag(self):
lambda_diff = self.state1._lambda - self.state2._lambda
sigma_diff = self.state2.sigma - self.state1.sigma
- Read upRead up
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
Open
def optimize_wavenumbers_by_svd(self, niter=1, derivative='n', tol=0.1,
Function _arange_levels
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _arange_levels(self, jrotn, par, iso, evalues, evecs, shift_enr=[0.0]):
Function plot_eigenfunctions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_eigenfunctions(self, nlevels, show=False, fname=None,
Function optimize_intensity_by_svd
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def optimize_intensity_by_svd(self, niter=1, derivative='n', tol=0.1,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, model, filep, rotc=0.0, shift_by=0.0, cfunc=None):
Function plot_hamiltonian_colormesh
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_hamiltonian_colormesh(self, rows=None, cols=None, show=False,
Function _calculate_numerical_derivatives
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _calculate_numerical_derivatives(self, ypar, yfixed, calculate_data,
Function optimize_levels_by_svd
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def optimize_levels_by_svd(self, niter=1, derivative='n', tol=0.1,
Function form_tridiag_matrix
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def form_tridiag_matrix(self, u, v, w, k1=-1, k2=0, k3=1):
Avoid deeply nested control flow statements. Open
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]
Function calculate_partition_functions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def calculate_partition_functions(self, Ia=0, Ib=0, T=296,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, objs, eig_decomp='lapack', lapack_driver='evr',
Function calculate_Einstein_coefficients
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def calculate_Einstein_coefficients(self, wavens, dmfs=None, ninter=1000,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, npoints, rgrid, solver='sinc', alpha=0.0, rbar=0.0):
Function _get_default_jrange
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _get_default_jrange(self, uterms, uj, lterms, lj):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, molecule, masses=None, niso=None, refj=None, ref_enr=None):
Function _write_pointwise_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _write_pointwise_data(self, fname, xpoints, ypoints, fixed):
Function _calculate_wavenumber_with_observations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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]]
- Read upRead up
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"