USDA-ARS-NWRC/smrf

View on GitHub

Showing 48 of 134 total issues

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 7 arguments (exceeds 6 allowed). Consider refactoring.
    Open

        def __init__(self, mx, my, mz, GridX, GridY, GridZ, config):
    Severity: Major
    Found in smrf/spatial/dk/dk.py - About 35 mins to fix

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

          def distribute(self, date_time, cloud_factor, illum_ang, cosz, azimuth,
      Severity: Major
      Found in smrf/distribute/solar.py - About 35 mins to fix

        Function toporad has 7 arguments (exceeds 6 allowed). Consider refactoring.
        Open

        def toporad(beam, diffuse, illum_angle, sky_view_factor, terrain_config_factor,
        Severity: Major
        Found in smrf/envphys/solar/toporad.py - About 35 mins to fix

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

              def __init__(self, mx, my, mz, GridX, GridY, GridZ, config):
          Severity: Major
          Found in smrf/spatial/kriging.py - About 35 mins to fix

            Function tracking_by_basin has 7 arguments (exceeds 6 allowed). Consider refactoring.
            Open

            def tracking_by_basin(precipitation, time, storm_lst, time_steps_since_precip,
            Severity: Major
            Found in smrf/envphys/storms.py - About 35 mins to fix

              Function catchment_ratios has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
              Open

              def catchment_ratios(ws, gauge_type, snowing):
                  """
                  Point models for catchment ratios of the
                  """
              
              
              Severity: Minor
              Found in smrf/envphys/precip.py - About 35 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 ephemeris has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
              Open

              def ephemeris(dt):
                  """
                  Calculates radius vector, declination, and apparent longitude
                  of sun, as function of the given date and time.
              
              
              Severity: Minor
              Found in smrf/envphys/sunang.py - About 35 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

              Severity
              Category
              Status
              Source
              Language