HarrisonKramer/optiland

View on GitHub

Showing 134 of 211 total issues

File spot_diagram.py has 470 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Spot Diagram Analysis
 
This module provides a spot diagram analysis for optical systems.
 
Kramer Harrison, 2024
Severity: Minor
Found in optiland/analysis/spot_diagram.py - About 7 hrs to fix

    File wavefront.py has 417 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """Wavefront Module
     
    This module defines the `Wavefront` class, which is designed to analyze the
    wavefront of an optical system. It supports the evaluation of wavefront
    aberrations using Zernike polynomials, the generation of wavefront maps for
    Severity: Minor
    Found in optiland/wavefront.py - About 6 hrs to fix

      File optic.py has 395 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Optic Module
       
      This is the core module of Optiland, which provides the class to define
      generic optical systems. The Optic class encapsulates the core properties
      of an optical system, such as the aperture, fields, surfaces, and
      Severity: Minor
      Found in optiland/optic/optic.py - About 5 hrs to fix

        File zemax_handler.py has 382 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """Zemax File Handler
         
        This module provides functionality for reading Zemax files and converting the
        data into Optiland Optic instances. The `load_zemax_file` function can be used
        to load a Zemax file and return an Optiland Optic object.
        Severity: Minor
        Found in optiland/fileio/zemax_handler.py - About 5 hrs to fix

          Optic has 33 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Optic:
          """The Optic class represents an optical system.
           
          Attributes:
          aperture (Aperture): The aperture of the optical system.
          Severity: Minor
          Found in optiland/optic/optic.py - About 4 hrs to fix

            ZemaxFileReader has 30 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class ZemaxFileReader:
            """A class for reading Zemax files and extracting optical data.
             
            Args:
            source (str): The source of the .zmx file, either a filename or a URL.
            Severity: Minor
            Found in optiland/fileio/zemax_handler.py - About 3 hrs to fix

              SurfaceGroup has 28 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class SurfaceGroup:
              """Represents a group of surfaces in an optical system.
               
              Attributes:
              surfaces (list): List of surfaces in the group.
              Severity: Minor
              Found in optiland/surfaces/surface_group.py - About 3 hrs to fix

                File mtf.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """Modulation Transfer Function (MTF) Module
                 
                This module provides various classes for the computation of the modulation
                transfer function (MTF) of an optical system.
                 
                 
                Severity: Minor
                Found in optiland/mtf.py - About 3 hrs to fix

                  File material_file.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """Material File
                   
                  This module contains a class for representing a material based on a material
                  YAML file from the refractiveindex.info database.
                   
                   
                  Severity: Minor
                  Found in optiland/materials/material_file.py - About 3 hrs to fix

                    File zernike.py has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """Zernike Geometry
                     
                    The Zernike polynomial geometry represents a surface defined by a Zernike
                    polynomial in two dimensions. The surface is defined as:
                     
                     
                    Severity: Minor
                    Found in optiland/geometries/zernike.py - About 2 hrs to fix

                      AberrationOperand has 25 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class AberrationOperand:
                      """A class that provides methods to calculate various aberration values for
                      an optic.
                       
                      Methods:
                      Severity: Minor
                      Found in optiland/optimization/operand/aberration.py - About 2 hrs to fix

                        File coatings.py has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        """Coatings Module
                         
                        The coatings module contains classes for modeling optical coatings.
                         
                        Kramer Harrison, 2024
                        Severity: Minor
                        Found in optiland/coatings.py - About 2 hrs to fix

                          Function generate_database has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def generate_database(output_file):
                          # load the catalog
                          filename = "catalog-nk.yml"
                           
                          with open(filename, encoding="utf-8") as file:
                          Severity: Minor
                          Found in optiland/database/generate_csv_database.py - About 2 hrs to fix

                          File ray.py has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          """Ray Operands Module
                           
                          This module provides a class that calculates various ray tracing values for an
                          optical system. It is used in conjunction with the optimization module to
                          optimize optical systems.
                          Severity: Minor
                          Found in optiland/optimization/operand/ray.py - About 2 hrs to fix

                            File surface_group.py has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            """Surface Group
                             
                            This module contains the SurfaceGroup class, which represents a group of
                            surfaces in an optical system. The SurfaceGroup class provides methods for
                            tracing rays through the surfaces, adding and removing surfaces, and
                            Severity: Minor
                            Found in optiland/surfaces/surface_group.py - About 2 hrs to fix

                              File lens.py has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              """Lens Visualization Module
                               
                              This module contains classes for visualizing lenses in 2D and 3D.
                               
                              Kramer Harrison, 2024
                              Severity: Minor
                              Found in optiland/visualization/lens.py - About 2 hrs to fix

                                Function _generate_indices has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def _generate_indices():
                                """Generate the indices for the Zernike terms.
                                 
                                Returns:
                                list: List of tuples representing the indices (n, m) of the
                                Severity: Minor
                                Found in optiland/zernike/noll.py - About 2 hrs to fix

                                Paraxial has 21 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class Paraxial:
                                """A class representing a paraxial optical system.
                                 
                                This class provides methods to calculate various properties of the optical
                                system, such as focal lengths, entrance pupil location, exit pupil
                                Severity: Minor
                                Found in optiland/paraxial.py - About 2 hrs to fix

                                  Function plot has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def plot(
                                  self,
                                  ax,
                                  fields="all",
                                  wavelengths="primary",
                                  Severity: Minor
                                  Found in optiland/visualization/rays.py - About 1 hr to fix

                                  Function _read_file has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def _read_file(self):
                                  """Reads the Zemax file and extracts the optical data."""
                                  encodings = ["utf-16", "utf-8", "iso-8859-1"]
                                  success = False
                                  for encoding in encodings:
                                  Severity: Minor
                                  Found in optiland/fileio/zemax_handler.py - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language