USDA-ARS-NWRC/smrf

View on GitHub

Showing 48 of 134 total issues

Function dist_precip_wind has 12 arguments (exceeds 6 allowed). Consider refactoring.
Open

def dist_precip_wind(precip, precip_temp, az, dir_round_cell, wind_speed,
Severity: Major
Found in smrf/envphys/precip.py - About 1 hr to fix

    Function distribute has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring.
    Open

        def distribute(self, data, dpt, precip_temp, ta, time, wind, temp,
                       wind_direction=None, dir_round_cell=None, wind_speed=None,
                       cell_maxus=None):
            """
            Distribute given a Panda's dataframe for a single time step. Calls
    Severity: Minor
    Found in smrf/distribute/precipitation.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 dist_precip_wind has 34 lines of code (exceeds 30 allowed). Consider refactoring.
    Open

    def dist_precip_wind(precip, precip_temp, az, dir_round_cell, wind_speed,
                         cell_maxus, tbreak, tbreak_direction, veg_type, veg_fact,
                         cfg, mask=None):
        """
        Redistribute the precip based on wind speed and direciton
    Severity: Minor
    Found in smrf/envphys/precip.py - About 1 hr to fix

      Function distribute has 11 arguments (exceeds 6 allowed). Consider refactoring.
      Open

          def distribute(self, data, dpt, precip_temp, ta, time, wind, temp,
      Severity: Major
      Found in smrf/distribute/precipitation.py - About 1 hr to fix

        Function stoporad has 11 arguments (exceeds 6 allowed). Consider refactoring.
        Open

        def stoporad(date_time, topo, cosz, azimuth, illum_ang, albedo_surface,
        Severity: Major
        Found in smrf/envphys/solar/toporad.py - About 1 hr to fix

          Function output has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
          Open

              def output(self, current_time_step,  module=None, out_var=None):
                  """
                  Output the forcing data or model outputs for the current_time_step.
          
                  Args:
          Severity: Minor
          Found in smrf/framework/model_framework.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 __init__ has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
          Open

              def __init__(self, variable_list, topo, date_time, config):
                  """
                  Initialize the output_hru() class
          
                  Args:
          Severity: Minor
          Found in smrf/output/output_hru.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 distribute_thread has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
          Open

              def distribute_thread(self, smrf_queue, data_queue=None):
                  """
                  Distribute the data using threading. All data is provided and
                  ``distribute_thread`` will go through each time step following the
                  methods outlined in :mod:`smrf.distribute.solar.solar.distribute`. The
          Severity: Minor
          Found in smrf/distribute/solar.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 _distribute has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
          Open

              def _distribute(self, data, other_attribute=None, zeros=None):
                  """
                  Distribute the data using the defined distribution method in
                  :py:attr:`config`
          
          
          Severity: Minor
          Found in smrf/distribute/image_data.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 decay_alb_power has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
          Open

          def decay_alb_power(veg, veg_type, start_decay, end_decay,
                              t_curr, pwr, alb_v, alb_ir):
              """
              Find a decrease in albedo due to litter acccumulation. Decay is based on
              max decay, decay power, and start and end dates. No litter decay occurs
          Severity: Minor
          Found in smrf/envphys/albedo.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 distribute has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
          Open

              def distribute(self, date_time, air_temp, vapor_pressure=None,
                             dew_point=None, cloud_factor=None):
                  """
                  Distribute for a single time step.
          
          
          Severity: Minor
          Found in smrf/distribute/thermal.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 backup_input has a Cognitive Complexity of 12 (exceeds 8 allowed). Consider refactoring.
          Open

          def backup_input(data, config_obj):
              """
              Backs up input data files so a user can rerun a run with the exact data
              used for a run.
          
          
          Severity: Minor
          Found in smrf/utils/utils.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 sunpath has a Cognitive Complexity of 12 (exceeds 8 allowed). Consider refactoring.
          Open

          def sunpath(latitude, longitude, declination, omega):
              """
              Sun angle from solar declination and longtitude
          
              Args:
          Severity: Minor
          Found in smrf/envphys/sunang.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 _initialize has a Cognitive Complexity of 12 (exceeds 8 allowed). Consider refactoring.
          Open

              def _initialize(self, topo, metadata):
                  """
                  Initialize the distribution based on the parameters in
                  :py:attr:`config`.
          
          
          Severity: Minor
          Found in smrf/distribute/image_data.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 __init__ has 9 arguments (exceeds 6 allowed). Consider refactoring.
          Open

              def __init__(self, config, mx, my, GridX, GridY,
          Severity: Major
          Found in smrf/spatial/grid.py - About 50 mins to fix

            Function initialize has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring.
            Open

                def initialize(self, topo, data):
                    """Initialize the model with data
            
                    Arguments:
                        topo {topo class} -- Topo class
            Severity: Minor
            Found in smrf/distribute/wind/winstral.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 time_since_storm has 8 arguments (exceeds 6 allowed). Consider refactoring.
            Open

            def time_since_storm(precipitation, perc_snow, time_step=1/24, mass=1.0,
            Severity: Major
            Found in smrf/envphys/storms.py - About 45 mins to fix

              Function time_since_storm_pixel has 8 arguments (exceeds 6 allowed). Consider refactoring.
              Open

              def time_since_storm_pixel(precipitation, dpt, perc_snow, storming,
              Severity: Major
              Found in smrf/envphys/storms.py - About 45 mins to fix

                Function decay_alb_power has 8 arguments (exceeds 6 allowed). Consider refactoring.
                Open

                def decay_alb_power(veg, veg_type, start_decay, end_decay,
                Severity: Major
                Found in smrf/envphys/albedo.py - About 45 mins to fix

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

                      def __init__(self, mx, my, GridX, GridY, mz=None, GridZ=None,
                  Severity: Major
                  Found in smrf/spatial/idw.py - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language