gwpy/timeseries/io/gwf/__init__.py

Summary

Maintainability
B
5 hrs
Test Coverage

Function register_gwf_api has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

def register_gwf_api(library):
    """Register a full set of GWF I/O methods for the given library

    The given frame library must define the following methods

Severity: Minor
Found in gwpy/timeseries/io/gwf/__init__.py - About 4 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 read_timeseriesdict has 9 arguments (exceeds 8 allowed). Consider refactoring.
Open

    def read_timeseriesdict(source, channels, start=None, end=None,
Severity: Major
Found in gwpy/timeseries/io/gwf/__init__.py - About 35 mins to fix

Function channel_dict_kwarg has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def channel_dict_kwarg(value, channels, types=None, astype=None):
    """Format the given kwarg value in a dict with one value per channel

    Parameters
    ----------
Severity: Minor
Found in gwpy/timeseries/io/gwf/__init__.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

There are no issues that match your filters.

Category
Status