arjunsavel/scope

View on GitHub

Showing 14 of 24 total issues

Function make_data has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

def make_data(
scale,
wlgrid,
wl_model,
Fp_conv,
Severity: Minor
Found in src/scope/run_simulation.py - About 4 hrs to fix

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

def write_input_file(data, output_file_path="input.txt"):
# Define the order and categories of parameters
 
categories = {
"Filepaths": [
Severity: Minor
Found in src/scope/input_output.py - About 2 hrs to fix

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

def add_tellurics_atran(
wl_cube_model, flux_cube_model, n_order, n_exp, vary_airmass=False
):
if vary_airmass:
# assume now that I'm just using the same airmasses as before.
Severity: Minor
Found in src/scope/tellurics.py - About 1 hr to fix

Function parse_arguments has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def parse_arguments():
parser = argparse.ArgumentParser(description="Simulate observation")
 
# Required parameters
parser.add_argument(
Severity: Minor
Found in src/scope/input_output.py - About 1 hr to fix

    Function doppler_shift_planet_star has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def doppler_shift_planet_star(
    model_flux_cube,
    n_exposure,
    phases,
    rv_planet,
    Severity: Minor
    Found in src/scope/utils.py - About 1 hr to fix

    Function add_quadratic_noise has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    def add_quadratic_noise(flux_cube_model, wl_grid, SNR, IGRINS=False, **kwargs):
    """
    Currently assumes that there are two bands: A and B.
     
    Inputs
    Severity: Minor
    Found in src/scope/noise.py - About 1 hr to fix

    Function get_rot_ker has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_rot_ker(
    v_sin_i: Union[float, np.ndarray, jnp.ndarray],
    wavelengths: Union[np.ndarray, jnp.ndarray, list],
    observation: str = "emission",
    ) -> jnp.ndarray:
    Severity: Minor
    Found in src/scope/broadening.py - About 1 hr to fix

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

    def add_tellurics(
    wl_cube_model,
    flux_cube_model,
    n_order,
    n_exp,
    Severity: Minor
    Found in src/scope/tellurics.py - About 1 hr to fix

    Function make_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def make_data(
    scale,
    wlgrid,
    wl_model,
    Fp_conv,
    Severity: Minor
    Found in src/scope/run_simulation.py - About 1 hr to fix

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

      def detrend_cube(cube, n_order, n_exp, blaze=False):
      """
      Detrends the cube by dividing each order by its maximum value.
       
      Inputs
      Severity: Minor
      Found in src/scope/utils.py - About 55 mins to fix

      Avoid deeply nested control flow statements.
      Open

      if isinstance(value, bool):
      value = str(value)
      elif isinstance(value, float):
      if np.isnan(value):
      value = "NULL"
      Severity: Major
      Found in src/scope/input_output.py - About 45 mins to fix

        Function scrape_igrins_etc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def scrape_igrins_etc(kmag, exposure_time):
        """
        pings the IGRINS exposure time calculator.
         
        Parameters
        Severity: Minor
        Found in src/scope/scrape_igrins_etc.py - About 25 mins to fix

        Function unpack_lines has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def unpack_lines(content):
        """
        Unpack lines from a file, removing comments and joining lines that are split.
         
        Parameters
        Severity: Minor
        Found in src/scope/input_output.py - About 25 mins to fix

        Function simulate_observation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def simulate_observation(
        planet_spectrum_path=".",
        star_spectrum_path=".",
        data_cube_path=".",
        phase_start=0,
        Severity: Minor
        Found in src/scope/run_simulation.py - About 25 mins to fix
        Severity
        Category
        Status
        Source
        Language