arjunsavel/SImMER

View on GitHub

Showing 41 of 189 total issues

Function plot_array has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
Open

def plot_array(
    plot_type, im_array, vmin, vmax, directory, filename, extent=None, snames=None, filts=None
):  # pylint: disable=too-many-arguments
    """
    Plots arrays produced in the process of the pipeline.
Severity: Minor
Found in src/simmer/plotting.py - About 6 hrs 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 image_driver has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

def image_driver(raw_dir, reddir, config, inst, sep_skies=False, plotting_yml=None, selected_stars = None, verbose=False):
    """Do flat division, sky subtraction, and initial alignment via coords in header.
    Returns Python list of each registration method used per star.

    Inputs:
Severity: Minor
Found in src/simmer/image.py - About 5 hrs 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 check_logsheet has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

def check_logsheet(inst, log_name, tab=None, add_dark_times=False):
    """Checks for common typos/type errors in the logsheet. Should be
    run if an Excel worksheet is sent.

    Inputs:
Severity: Minor
Found in src/simmer/check_logsheet.py - About 5 hrs 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 validate_config has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def validate_config(config, raw_dir, inst, verbose=False):
    if verbose:
        logger.setLevel(logging.DEBUG)

    logger.debug("inspecting directory: %s", raw_dir)
Severity: Minor
Found in src/simmer/validate_config.py - About 4 hrs 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 add_dark_exp has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

def add_dark_exp(inst, log, raw_dir, tab=None):
    """Adds dark exposures to the end of log sheet if not specified.

    Inputs:
        :tab: (string) tab of Excel sheet to be used.
Severity: Minor
Found in src/simmer/add_dark_exp.py - About 3 hrs 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 sky_driver has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def sky_driver(raw_dir, reddir, config, inst, sep_skies = False, plotting_yml=None):
    """Night should be entered in format 'yyyy_mm_dd' as string.
    This will point toward a config file for the night with flats listed.

    Inputs:
Severity: Minor
Found in src/simmer/sky.py - About 3 hrs 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_im has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def create_im(s_dir, ssize1, plotting_yml=None, fdirs=None, method="quick_look", verbose=False):
    """Take the shifted, cut down images from before, then perform registration
    and combine. Tests should happen before this, as this is a per-star basis.

    Inputs:
Severity: Minor
Found in src/simmer/image.py - About 3 hrs 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_imstack has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def create_imstack(
    raw_dir, reddir, s_dir, imlist, inst, plotting_yml=None, filter_name=None
):
    """Create the stack of images by performing flat division, sky subtraction.

Severity: Minor
Found in src/simmer/image.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_skies has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def create_skies(
    raw_dir, reddir, s_dir, skylist, inst, plotting_yml=None, filter_name=None
):
    """Create a sky from a single list of skies.
    sf_dir is the reduced directory for the specific star and filter.
Severity: Minor
Found in src/simmer/sky.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 all_driver has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def all_driver(

    inst, config_file, raw_dir, reddir, sep_skies = False, plotting_yml=None, searchsize=10, just_images=False, selected_stars=None, verbose=True

):
Severity: Minor
Found in src/simmer/drivers.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 all_driver has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

def all_driver(
Severity: Major
Found in src/simmer/drivers.py - About 1 hr to fix

    Function plot_array has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def plot_array(
    Severity: Major
    Found in src/simmer/plotting.py - About 1 hr to fix

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

      def register_bruteforce(image, rough_center=None):
          """
          Performs the default image registration scheme. Shifts the center of the
          image to the peak.
      
      
      Severity: Minor
      Found in src/simmer/registration.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_imstack has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def create_imstack(
          raw_dir, reddir, s_dir, imlist, inst, plotting_yml=None, filter_name=None
      ):
          """Create the stack of images by performing flat division, sky subtraction.
      
      
      Severity: Minor
      Found in src/simmer/image.py - About 1 hr to fix

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

        def image_driver(raw_dir, reddir, config, inst, sep_skies=False, plotting_yml=None, selected_stars = None, verbose=False):
        Severity: Major
        Found in src/simmer/image.py - About 1 hr to fix

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

          def search_headers(raw_dir, write_dir=None):
              """Function to perform search of FITS headers.
          
              Inputs:
                  :raw_dir: (string) absolute path to directory containing raw data.
          Severity: Minor
          Found in src/simmer/search_headers.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 gaus2d3 has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def gaus2d3(x=0, y=0, mx=0, my=0, sx=1, sy=1, theta=0):
          Severity: Major
          Found in src/simmer/registration.py - About 50 mins to fix

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

            def create_skies(
            Severity: Major
            Found in src/simmer/sky.py - About 50 mins to fix

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

              def create_flats(
              Severity: Major
              Found in src/simmer/flats.py - About 50 mins to fix

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

                def calc_shifts(
                Severity: Major
                Found in src/simmer/registration.py - About 50 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language