arjunsavel/cortecs

View on GitHub

Showing 24 of 26 total issues

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

def chunk_wavelengths_cia(file, ref_file_base, numfiles):
    """
    Performs chunking based on the reference file's wavelength chunking.
    Inputs
    -------
Severity: Minor
Found in src/cortecs/opac/interpolate_cia.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 fit_neural_net has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

def fit_neural_net(
Severity: Major
Found in src/cortecs/fit/fit_neural_net.py - About 1 hr to fix

    Function calc_metrics has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def calc_metrics(fitter, tp_undersample_factor=1, wl_under_sample_factor=8, plot=False):
        """
            calculates the mean and percent error  associated with the fit.
        .
            Inputs
    Severity: Minor
    Found in src/cortecs/fit/metrics.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 chunk_wavelengths has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def chunk_wavelengths(
        file,
        nchunks=None,
        wav_per_chunk=None,
        adjust_wavelengths=False,
    Severity: Minor
    Found in src/cortecs/opac/chunking.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 eval_pca has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def eval_pca(
    Severity: Major
    Found in src/cortecs/eval/eval_pca.py - About 1 hr to fix

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

      def eval_neural_net(
      Severity: Major
      Found in src/cortecs/eval/eval_neural_net.py - About 1 hr to fix

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

        def optimize_neural_net(
        Severity: Major
        Found in src/cortecs/opt/optimize_neural_net.py - About 1 hr to fix

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

              def __init__(
          Severity: Major
          Found in src/cortecs/opac/io.py - About 1 hr to fix

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

            def eval_polynomial(
            Severity: Major
            Found in src/cortecs/eval/eval_polynomial.py - About 1 hr to fix

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

                  def get_lams_and_opacities(self, file):
                      """
                      Takes in an opacity file and returns an array of all wavelengths within the file.
              
                      Returns the opacities, as well — so that the file is only iterated through once.
              Severity: Minor
              Found in src/cortecs/opac/io.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 interpolate_cia has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def interpolate_cia(
                  cia_file, reference_file, outfile=None, loader="exotransmit", load_kwargs=None
              ):
                  """
                  Interpolates a CIA file to a higher resolution, using the wavelength grid
              Severity: Minor
              Found in src/cortecs/opac/interpolate_cia.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 add_lams has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              def add_lams(max_lam_to_add_ind, file, next_file):
                  """
                  Takes the first `max_lam_to_add_ind` opacities from next_file and appends them to file.
              
                  Inputs:
              Severity: Minor
              Found in src/cortecs/opac/chunking.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 optimize_pca has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def optimize_pca(
              Severity: Minor
              Found in src/cortecs/opt/optimize_pca.py - About 45 mins to fix

                Function chunk_wavelengths has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def chunk_wavelengths(
                Severity: Minor
                Found in src/cortecs/opac/chunking.py - About 45 mins to fix

                  Function fit_pca has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def fit_pca(cross_section, P, T, prep_res, fit_axis="pressure", **kwargs):
                  Severity: Minor
                  Found in src/cortecs/fit/fit_pca.py - About 45 mins to fix

                    Function join_cross_section has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def join_cross_section(self, opac):
                            """
                            joins another opacity's cross-section data to this one.
                            :param opac:
                            :return:
                    Severity: Minor
                    Found in src/cortecs/opac/opac.py - About 45 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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(
                    Severity: Minor
                    Found in src/cortecs/opac/io.py - About 35 mins to fix

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

                      def prep_pca(
                      Severity: Minor
                      Found in src/cortecs/fit/fit_pca.py - About 35 mins to fix

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

                        def interpolate_cia(
                        Severity: Minor
                        Found in src/cortecs/opac/interpolate_cia.py - About 35 mins to fix

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

                          def fit_polynomial(
                          Severity: Minor
                          Found in src/cortecs/fit/fit_polynomial.py - About 35 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language