src/gyptis/sources/stack.py
File stack.py
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Benjamin Vial
# This file is part of gyptis
# Version: 1.0.2
Function make_stack
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
def make_stack(
geometry,
coefficients,
plane_wave,
polarization="TM",
- 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
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 field_stack_3D
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def field_stack_3D(phi, alpha, beta, gamma, zshift=0, degree=1, domain=None):
Function make_stack
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def make_stack(
Function solve
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def solve(thicknesses, eps, mu, lambda0, theta0, phi0, psi0):
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):
Function get_stack_efficiencies
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_stack_efficiencies(thicknesses, epsilon, mu, lambda0, angles):
Function get_coeffs_stack
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_coeffs_stack(config, lambda0, theta0, phi0, psi0):