benvial/gyptis

View on GitHub

Showing 161 of 211 total issues

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

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

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

        def add_ellipse(self, x, y, z, ax, ay, surface=True, **kwargs):
    Severity: Major
    Found in src/gyptis/geometry/geometry.py - About 50 mins to fix

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

          def eigensolve(
      Severity: Major
      Found in src/gyptis/models/simulation.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/twoscale3d.py - About 50 mins to fix

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

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

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

                def __init__(
            Severity: Minor
            Found in src/gyptis/optimize.py - About 45 mins to fix

              Function plot_geometry has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def plot_geometry(self, nper=1, ax=None, c="k", **kwargs):
                      if ax is None:
                          ax = plt.gca()
                      domains = self.geometry.subdomains["surfaces"]
                      scatt = [d for d in domains if d not in self.geometry.layers]
              Severity: Minor
              Found in src/gyptis/models/grating2d.py - About 45 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 get_boundaries has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_boundaries(self, idf, dim=None, physical=True):
                      dim = self._check_dim(dim)
                      if isinstance(idf, str):
                          if dim == 2:
                              type_entity = "surfaces"
              Severity: Minor
              Found in src/gyptis/geometry/geometry.py - About 45 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

              Avoid deeply nested control flow statements.
              Open

                                  if callable(k):
                                      const = False
                                      break
                          # if p.shape != (2, 2):
                          #     p = p[:2][:2]
              Severity: Major
              Found in src/gyptis/materials.py - About 45 mins to fix

                Function plot_markers has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def plot_markers(markers, subdomains, ax=None, geometry=None, colorbar=True, **kwargs):
                Severity: Minor
                Found in src/gyptis/plot.py - About 45 mins to fix

                  Function filtering has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def filtering(a, rfilt=0, function_space=None, degree=1, solver=None, mesh=None):
                  Severity: Minor
                  Found in src/gyptis/optimize.py - About 45 mins to fix

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

                        def __init__(self, wavelength, dim, phase=0, amplitude=1, degree=1, domain=None):
                    Severity: Minor
                    Found in src/gyptis/sources/source.py - About 45 mins to fix

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

                          def __init__(
                      Severity: Minor
                      Found in src/gyptis/models/phc3d.py - About 45 mins to fix

                        Function plot_bands has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def plot_bands(
                            sym_points,
                            nband,
                            eigenvalues,
                            xtickslabels=None,
                        Severity: Minor
                        Found in src/gyptis/utils/bands.py - About 45 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 cut has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def cut(self, id1, id2, dim1=None, dim2=None, sync=True, **kwargs):
                        Severity: Minor
                        Found in src/gyptis/geometry/geometry.py - About 45 mins to fix

                          Function plot_bands has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def plot_bands(
                          Severity: Minor
                          Found in src/gyptis/utils/bands.py - About 45 mins to fix

                            Function add_circle has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def add_circle(self, x, y, z, r, surface=True, **kwargs):
                            Severity: Minor
                            Found in src/gyptis/geometry/geometry.py - About 45 mins to fix

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

                                  def __init__(self, dict, geometry=None, pmls=None, dim=2, degree=1, element=None):
                              Severity: Minor
                              Found in src/gyptis/materials.py - About 45 mins to fix

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

                                    def __init__(
                                Severity: Minor
                                Found in src/gyptis/measure.py - About 45 mins to fix

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

                                      def __init__(self, markers, subdomains, mapping, *args, **kwargs):
                                  Severity: Minor
                                  Found in src/gyptis/materials.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language