Unidata/MetPy

View on GitHub
src/metpy/io/text.py

Summary

Maintainability
A
0 mins
Test Coverage

Function parse_wpc_surface_bulletin has a Cognitive Complexity of 31 (exceeds 15 allowed). Consider refactoring.
Wontfix

def parse_wpc_surface_bulletin(bulletin, year=None):
    """Parse a coded surface bulletin from NWS WPC into a Pandas DataFrame.

    Parameters
    ----------
Severity: Minor
Found in src/metpy/io/text.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

Avoid deeply nested control flow statements.
Wontfix

                    if len(item) <= 4 and item[0] in {'8', '9', '1'}:
                        strength = int(item)
                    else:
                        parsed_text.append((valid_time, feature.rstrip('S'), strength,
                                            Point(_decode_coords(item))))
Severity: Major
Found in src/metpy/io/text.py - About 45 mins to fix

    There are no issues that match your filters.

    Category
    Status