gwpy/timeseries/timeseries.py

Summary

Maintainability
F
4 days
Test Coverage

File timeseries.py has 1902 lines of code (exceeds 1000 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2014-2020)
#
# This file is part of GWpy.
#
Severity: Major
Found in gwpy/timeseries/timeseries.py - About 2 days to fix

TimeSeries has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

class TimeSeries(TimeSeriesBase):
    """A time-domain data array.

    Parameters
    ----------
Severity: Minor
Found in gwpy/timeseries/timeseries.py - About 4 hrs to fix

Function filter has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def filter(self, *filt, **kwargs):
        """Filter this `TimeSeries` with an IIR or FIR filter

        Parameters
        ----------
Severity: Minor
Found in gwpy/timeseries/timeseries.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 spectral_variance has 14 arguments (exceeds 8 allowed). Consider refactoring.
Open

    def spectral_variance(self, stride, fftlength=None, overlap=None,
Severity: Major
Found in gwpy/timeseries/timeseries.py - About 1 hr to fix

Function q_transform has 14 arguments (exceeds 8 allowed). Consider refactoring.
Open

    def q_transform(self,
Severity: Major
Found in gwpy/timeseries/timeseries.py - About 1 hr to fix

Function resample has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def resample(self, rate, window='hamming', ftype='fir', n=None):
        """Resample this Series to a new rate

        Parameters
        ----------
Severity: Minor
Found in gwpy/timeseries/timeseries.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 q_transform has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def q_transform(self,
                    qrange=qtransform.DEFAULT_QRANGE,
                    frange=qtransform.DEFAULT_FRANGE,
                    gps=None,
                    search=.5,
Severity: Minor
Found in gwpy/timeseries/timeseries.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 average_fft has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def average_fft(self, fftlength=None, overlap=0, window=None):
        """Compute the averaged one-dimensional DFT of this `TimeSeries`.

        This method computes a number of FFTs of duration ``fftlength``
        and ``overlap`` (both given in seconds), and returns the mean
Severity: Minor
Found in gwpy/timeseries/timeseries.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 whiten has 9 arguments (exceeds 8 allowed). Consider refactoring.
Open

    def whiten(self, fftlength=None, overlap=0, method=DEFAULT_FFT_METHOD,
Severity: Major
Found in gwpy/timeseries/timeseries.py - About 35 mins to fix

Function taper has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def taper(self, side='leftright', duration=None, nsamples=None):
        """Taper the ends of this `TimeSeries` smoothly to zero.

        Parameters
        ----------
Severity: Minor
Found in gwpy/timeseries/timeseries.py - About 25 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