Showing 161 of 211 total issues
Function read_mesh_info
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def read_mesh_info(self):
if self.dim == 1:
marker_dim = "line"
sub_dim = "curves"
marker_dim_minus_1 = "point"
- 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 __init__
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _get_effective_coeff
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _get_effective_coeff(self, case, scalar=False):
self.solve_param(case, scalar=scalar)
xi = self.formulation.xi.as_subdomain()
if xi.real.ufl_shape == (2, 2):
if scalar:
- 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 eigensolve
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def eigensolve(
self,
n_eig=6,
wavevector_target=0.0,
tol=1e-6,
- 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 _weak
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _weak(self, u, v, u1):
xi = self.xi.as_subdomain()
chi = self.chi.as_subdomain()
xi_dict = self.xi.as_property()
- 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 _make_constant_property_3d
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _make_constant_property_3d(prop, inv=False, real=False):
new_prop = {}
for d, p in prop.items():
lenp = _check_len(p)
if lenp > 0:
- 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 get_T_matrix_coeff
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_T_matrix_coeff(
self,
p0,
p1,
source_type,
- 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 solve
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def solve(thicknesses, eps, mu, lambda0, theta0, phi0, psi0):
k0 = 2 * pi / lambda0
omega = k0 * c
alpha0 = -k0 * np.sin(theta0) * np.cos(phi0)
Function _topopt_wrapper
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def _topopt_wrapper(
Function u
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def u(x, n, m, y=None):
y = y or sqrt_safe(1 - x**2)
if m < 0:
return (-1) ** (-m + 1) * u(x, n, -m)
elif m == 0:
- 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 tensor_const
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def tensor_const(T, dim=3, real=False, const=True):
if dim not in (2, 3):
raise NotImplementedError("only supports dim = 2 or 3")
def _treal(T):
- 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 get_periodic_bnds
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_periodic_bnds(self):
# define lines equations
def _is_on_line(p, p1, p2):
x, y = p
x1, y1 = p1
- 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 compute_absorption
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def compute_absorption(self, subdomain_absorption=False):
P0 = (
self.period[0]
* self.period[1]
* (epsilon_0 / mu_0) ** 0.5
- 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 __init__
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
box_size=(1, 1),
box_center=(0, 0),
pml_width=(0.2, 0.2),
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
vectors,
periodic_tol=1e-8,
**kwargs,
Function build_geometry
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_geometry(wavelength, pmesh):
thicknesses = OrderedDict(
{
"pml_bottom": wavelength,
"substrate": wavelength * 1,
Function __init__
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
model_name="geometry",
mesh_name="mesh.msh",
data_dir=None,
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(