benvial/gyptis

View on GitHub

Showing 161 of 211 total issues

Function postpro_download_links has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def postpro_download_links(fn):
    sgfoot = None
    with open(fn, "r") as file:
        soup = BeautifulSoup(file, "html.parser")
    for item in soup.findAll(["div"]):
Severity: Minor
Found in docs/postprocess.py - About 1 hr 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 create_geometry has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def create_geometry(wavelength, pml_width):
    R1 = 60
    R2 = 30
    Rcalc = 2 * R1
    lmin = wavelength / pmesh
Severity: Minor
Found in examples/scattering/plot_silver_core_shell.py - About 1 hr to fix

    Function plane_wave_3d has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def plane_wave_3d(
    Severity: Major
    Found in src/gyptis/sources/pw.py - About 1 hr to fix

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

          def __init__(
      Severity: Major
      Found in src/gyptis/formulations/formulation.py - About 1 hr to fix

        Function get_T_matrix_coeff has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def get_T_matrix_coeff(
        Severity: Major
        Found in src/gyptis/models/scattering3d.py - About 1 hr to fix

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

              def __init__(
          Severity: Major
          Found in src/gyptis/sources/dipole.py - About 1 hr to fix

            Function get_periodic_bnds has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def get_periodic_bnds(self):
                    verts = self.vertices
                    # get all boundaries
                    bnds = self.get_entities(2)
                    maps = []
            Severity: Minor
            Found in src/gyptis/geometry/phc3d.py - About 55 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 field_stack_3D has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def field_stack_3D(phi, alpha, beta, gamma, zshift=0, degree=1, domain=None):
            Severity: Major
            Found in src/gyptis/sources/stack.py - About 50 mins to fix

              Function plot_real has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def plot_real(
              Severity: Major
              Found in src/gyptis/plot.py - About 50 mins to fix

                Function plot_complex has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def plot_complex(
                Severity: Major
                Found in src/gyptis/plot.py - About 50 mins to fix

                  Function make_stack has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def make_stack(
                  Severity: Major
                  Found in src/gyptis/sources/stack.py - About 50 mins to fix

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

                        def __init__(
                    Severity: Major
                    Found in src/gyptis/sources/ls.py - About 50 mins to fix

                      Function solve has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def solve(thicknesses, eps, mu, lambda0, theta0, phi0, psi0):
                      Severity: Major
                      Found in src/gyptis/sources/stack.py - About 50 mins to fix

                        Function _build_serial has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def _build_serial(
                        Severity: Major
                        Found in src/gyptis/geometry/geometry.py - About 50 mins to fix

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

                              def __init__(
                          Severity: Major
                          Found in src/gyptis/models/twoscale3d.py - About 50 mins to fix

                            Function fragment has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def fragment(self, id1, id2, dim1=None, dim2=None, sync=True, map=False, **kwargs):
                            Severity: Major
                            Found in src/gyptis/geometry/geometry.py - About 50 mins to fix

                              Function intersect has 7 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def intersect(self, id1, id2, dim1=None, dim2=None, sync=True, map=False, **kwargs):
                              Severity: Major
                              Found in src/gyptis/geometry/geometry.py - About 50 mins to fix

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

                                    def __init__(
                                Severity: Major
                                Found in src/gyptis/formulations/_high_contrast.py - About 50 mins to fix

                                  Function green_function_2d has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def green_function_2d(wavelength, xs, ys, phase=0, amplitude=1, degree=1, domain=None):
                                  Severity: Major
                                  Found in src/gyptis/sources/ls.py - About 50 mins to fix

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

                                        def __init__(
                                    Severity: Major
                                    Found in src/gyptis/formulations/twoscale2d.py - About 50 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language