Showing 161 of 211 total issues
Function plane_wave_2d
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plane_wave_2d(wavelength, theta, phase=0, amplitude=1, degree=1, domain=None):
Function field_stack_2D
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def field_stack_2D(phi, alpha, beta, yshift=0, degree=1, domain=None):
Avoid deeply nested control flow statements. Open
Open
if znew not in z:
z.append(znew)
tnew = f(znew)
if multi_output:
t.append(tnew[0])
Function plot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot(fplot, ax=None, geometry=None, proj_space=None, colorbar=True, **kwargs):
Function _cplx_iter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _cplx_iter(f):
def wrapper(v, *args, **kwargs):
iterable = isinstance(v, Iterable)
cplx = any(iscomplex(v_) for v_ in v) if iterable else iscomplex(v)
if cplx:
- 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 main
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def main():
p = optparse.OptionParser(__doc__)
options, args = p.parse_args()
if len(args) < 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"
Further reading
Consider simplifying this complex logical expression. Open
Open
if ison0 and ison1 and ison2:
y = set_coord(x - v[0] - v[1] - v[2], y)
elif ison0 and ison2:
y = set_coord(x - v[0] - v[2], y)
Function download_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def download_data(
Function plot_rods
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_rods(ax, rod_positions, rod_radii, *args, **kwargs):
Function diffraction_efficiencies
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def diffraction_efficiencies(
Function diffraction_efficiencies
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def diffraction_efficiencies(
Function calculate_analytical_cross_sections
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def calculate_analytical_cross_sections(eps_cyl, eps_bg, wavelength, radius, N=50):
Function __new__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __new__(cls, markers, subdomains, mapping, cpp=True, **kwargs):
Function plot_boundaries
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def plot_boundaries(markers, domain=None, shift=(0, 0), ax=None, **kwargs):
Function is_on_plane
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def is_on_plane(P, A, B, C, eps=dolfin.DOLFIN_EPS):
Function read_mesh
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def read_mesh(mesh_file, data_dir=None, data_dir_xdmf=None, dim=3, subdomains=None):
Function transfer_sub_mesh
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def transfer_sub_mesh(x, geometry, source_space, target_space, subdomain):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function maxwell
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def maxwell(self, u, v, xi, chi, domain="everywhere"):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(