benvial/gyptis

View on GitHub

Showing 161 of 211 total issues

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

    def __init__(
Severity: Minor
Found in src/gyptis/models/hc2d.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 is_on_plane has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def is_on_plane(P, A, B, C, eps=dolfin.DOLFIN_EPS):
      Severity: Minor
      Found in src/gyptis/geometry/geometry.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/metaclasses.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 __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 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 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 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 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 transfer_sub_mesh has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def transfer_sub_mesh(x, geometry, source_space, target_space, subdomain):
                      Severity: Minor
                      Found in src/gyptis/optimize.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 download_data has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

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

                            def calculate_analytical_cross_sections(eps_cyl, eps_bg, wavelength, radius, N=50):
                            Severity: Minor
                            Found in examples/scattering/effs_scatt_cylinder.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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

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

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

                                  def plot_boundaries(markers, domain=None, shift=(0, 0), ax=None, **kwargs):
                                  Severity: Minor
                                  Found in src/gyptis/plot.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 __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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language