USDA-ARS-NWRC/smrf

View on GitHub
smrf/envphys/storms.py

Summary

Maintainability
B
4 hrs
Test Coverage

Function tracking_by_station has a Cognitive Complexity of 22 (exceeds 8 allowed). Consider refactoring.
Open

def tracking_by_station(precip, mass_thresh=0.01, steps_thresh=3):
    """
    Processes the vector station data prior to the data being distributed

    Args:
Severity: Minor
Found in smrf/envphys/storms.py - About 2 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 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 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

        There are no issues that match your filters.

        Category
        Status