benvial/gyptis

View on GitHub

Showing 161 of 211 total issues

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

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

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

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

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

      def plot_arrow(a, x, y, dx, dy):
      Severity: Minor
      Found in examples/sources/plot_sources.py - About 35 mins to fix

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

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

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

              def diffraction_efficiencies(
          Severity: Minor
          Found in src/gyptis/models/grating3d.py - About 35 mins to fix

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

            def download_example_data(
            Severity: Minor
            Found in src/gyptis/utils/data_download.py - About 35 mins to fix

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

              def _adaptive_sampler(f, z0, max_bend=10, max_z_rel=1e-3, max_df=0.05):
              Severity: Minor
              Found in src/gyptis/utils/sample.py - About 35 mins to fix

                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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language