benvial/gyptis

View on GitHub

Showing 211 of 211 total issues

Function simp has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def simp(a, s_min=1, s_max=2, p=1, complex=True):
Severity: Minor
Found in src/gyptis/optimize.py - About 35 mins to fix

    Function get_stack_efficiencies has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def get_stack_efficiencies(thicknesses, epsilon, mu, lambda0, angles):
    Severity: Minor
    Found in src/gyptis/sources/stack.py - About 35 mins to fix

      Function rotate has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def rotate(self, tag, point, axis, angle, dim=None):
      Severity: Minor
      Found in src/gyptis/geometry/geometry.py - About 35 mins to fix

        Function get_coeffs_stack has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def get_coeffs_stack(config, lambda0, theta0, phi0, psi0):
        Severity: Minor
        Found in src/gyptis/sources/stack.py - About 35 mins to fix

          Function add_square has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def add_square(self, x, y, z, dx, **kwargs):
          Severity: Minor
          Found in src/gyptis/geometry/geometry.py - About 35 mins to fix

            Function maxwell has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def maxwell(self, u, v, epsilon, inv_mu, domain="everywhere"):
            Severity: Minor
            Found in src/gyptis/formulations/maxwell3d.py - About 35 mins to fix

              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Minor
              Found in src/gyptis/geometry/scattering3d.py - About 35 mins to fix

                Function get_cross_sections_analytical has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def get_cross_sections_analytical(k0, a, eps_sphere=4, eps_bg=1, Nmax=25):
                Severity: Minor
                Found in examples/scattering/mie.py - About 35 mins to fix

                  Function __new__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __new__(self, markers, subdomains, mapping, cpp=True, **kwargs):
                  Severity: Minor
                  Found in src/gyptis/materials.py - About 35 mins to fix

                    Function __new__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __new__(self, markers, subdomains, mapping, cpp=True, **kwargs):
                    Severity: Minor
                    Found in src/gyptis/materials.py - About 35 mins to fix

                      Function density_proj_filt has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def density_proj_filt(self, density, proj, filt, filtering_type):
                      Severity: Minor
                      Found in tutorials/optimization/plot_optim.py - About 35 mins to fix

                        Function env_get_outdated has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def env_get_outdated(app, env, added, changed, removed):
                        Severity: Minor
                        Found in docs/conf.py - About 35 mins to fix

                          Function jacobian_matrix has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def jacobian_matrix(self):
                                  if self.direction == "x":
                                      s = self.stretch, 1, 1
                                  elif self.direction == "y":
                                      s = 1, self.stretch, 1
                          Severity: Minor
                          Found in src/gyptis/materials.py - About 35 mins to fix

                          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 build_geometry has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def build_geometry(pmesh):
                              pmesh_scatt = 1 * pmesh
                              b = a * 2 * 1.2
                              box_size = (b, b, b)
                              pml_width = (lambda0, lambda0, lambda0)
                          Severity: Minor
                          Found in examples/scattering/dielectric_sphere.py - About 35 mins to fix

                          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 __new__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def __new__(cls, markers, subdomains, mapping, cpp=True, **kwargs):
                                  iterable = any(isiter(v) for v in mapping.values())
                                  flatvals = _flatten_list(mapping.values())
                                  cplx = any(iscomplex(v) and np.any(v.imag != 0) for v in flatvals)
                                  if iterable:
                          Severity: Minor
                          Found in src/gyptis/materials.py - About 35 mins to fix

                          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 set_size has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def set_size(self, idf, s, dim=None):
                                  if hasattr(idf, "__len__") and not isinstance(idf, str):
                                      for i, id_ in enumerate(idf):
                                          s_ = s[i] if hasattr(s, "__len__") else s
                                          params = {id_: s_}
                          Severity: Minor
                          Found in src/gyptis/geometry/geometry.py - About 35 mins to fix

                          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 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def weak(self, a):
                                  self.mesh = a.function_space().mesh() if self._mesh is None else self._mesh
                                  self.dim = self.mesh.ufl_domain().geometric_dimension()
                                  self.function_space = self._function_space or df.FunctionSpace(
                                      self.mesh, "CG", self.degree
                          Severity: Minor
                          Found in src/gyptis/optimize.py - About 35 mins to fix

                          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 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def compute_absorption(self, subdomain_absorption=False):
                                  omega = self.source.pulsation
                                  doms_no_pml = [
                                      z for z in self.epsilon.keys() if z not in ["pml_bottom", "pml_top"]
                                  ]
                          Severity: Minor
                          Found in src/gyptis/models/grating2d.py - About 35 mins to fix

                          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 plot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def plot(self, figsize=None, ax=None):
                                  if self.dim == 2:
                                      tri, cb = plot(self.expression, mesh=self.domain, ax=ax)
                                      fig = plt.gcf()
                                      ax = fig.axes
                          Severity: Minor
                          Found in src/gyptis/sources/source.py - About 35 mins to fix

                          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 plot_field has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def plot_field(
                                  self,
                                  nper=1,
                                  type="real",
                                  field="total",
                          Severity: Minor
                          Found in src/gyptis/models/grating2d.py - About 35 mins to fix

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language