Showing 218 of 305 total issues

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 host_resolution_order has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def host_resolution_order(ifo, env='NDSSERVER', epoch='now',
                          lookback=14*86400):
    """Generate a logical ordering of NDS (host, port) tuples for this IFO

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

def from_timeseries(ts1, ts2, stride, fftlength=None, overlap=None,
                    window=None, nproc=1, **kwargs):
    """Calculate the coherence `Spectrogram` between two `TimeSeries`.

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

    def query_dqsegdb(cls, flags, *args, **kwargs):
        """Query the advanced LIGO DQSegDB for a list of flags.

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

    def tile(self, x, y, w, h, color=None,
             anchor='center', edgecolors='face', linewidth=0.8,
             **kwargs):
        """Plot rectanguler tiles based onto these `Axes`.

Severity: Minor
Found in gwpy/plot/axes.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 xlim_as_gps has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def xlim_as_gps(func):
    """Wrap ``func`` to handle pass limit inputs through `gwpy.time.to_gps`
    """
    @wraps(func)
    def wrapped_func(self, left=None, right=None, **kw):
Severity: Minor
Found in gwpy/plot/axes.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 crop_frequencies has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def crop_frequencies(self, low=None, high=None, copy=False):
        """Crop this `Spectrogram` to the specified frequencies

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

    def set_unit(self, unit):
        """Set the GPS step scale
        """
        # accept all core time units
        if unit is None or (
Severity: Minor
Found in gwpy/plot/gps.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 read_gstlal_sngl has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def read_gstlal_sngl(source, **kwargs):
    """Read a `sngl_inspiral` table from one or more GstLAL LIGO_LW XML files

    source : `file`, `str`, :class:`~ligo.lw.ligolw.Document`, `list`
        one or more open files, file paths, or LIGO_LW `Document` objects
Severity: Minor
Found in gwpy/table/io/gstlal.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 write_channel_list_file has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def write_channel_list_file(channels, fobj):
    """Write a `~gwpy.detector.ChannelList` to a INI-format channel list file
    """
    out = configparser.ConfigParser(dict_type=OrderedDict)
    for channel in channels:
Severity: Minor
Found in gwpy/detector/io/clf.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 __init__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, bits, channel=None, epoch=None, description=None):
        # handle dict of (index, bitname) pairs
        if isinstance(bits, dict):
            n = max(map(int, bits.keys())) + 1
            list.__init__(self, [None] * n)
Severity: Minor
Found in gwpy/timeseries/statevector.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 _rates_preprocess has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def _rates_preprocess(func):
    @wraps(func)
    def wrapped_func(self, *args, **kwargs):
        timecolumn = kwargs.get('timecolumn')
        start = kwargs.get('start')
Severity: Minor
Found in gwpy/table/table.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 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 is_wav has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def is_wav(origin, filepath, fileobj, *args, **kwargs):
    """Identify a file as WAV

    See `astropy.io.registry` for details on how this function is used.
    """
Severity: Minor
Found in gwpy/timeseries/io/wav.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 write_hdf5_dict has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def write_hdf5_dict(flags, output, path=None, append=False, overwrite=False,
                    **kwargs):
    """Write this `DataQualityFlag` to a `h5py.Group`.

    This allows writing to an HDF5-format file.
Severity: Minor
Found in gwpy/segments/io/hdf5.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 fetch has 13 arguments (exceeds 8 allowed). Consider refactoring.
Open

def fetch(channels, start, end, type=None, dtype=None, allow_tape=None,
Severity: Major
Found in gwpy/timeseries/io/nds2.py - About 1 hr to fix

Function fetch has 13 arguments (exceeds 8 allowed). Consider refactoring.
Open

    def fetch(cls, channel, start, end, host=None, port=None, verbose=False,
Severity: Major
Found in gwpy/timeseries/core.py - About 1 hr to fix

Function fetch has 13 arguments (exceeds 8 allowed). Consider refactoring.
Open

    def fetch(cls, channels, start, end, host=None, port=None,
Severity: Major
Found in gwpy/timeseries/core.py - About 1 hr to fix

Function find has 13 arguments (exceeds 8 allowed). Consider refactoring.
Open

    def find(cls, channels, start, end, frametype=None,
Severity: Major
Found in gwpy/timeseries/core.py - About 1 hr to fix
Severity
Category
Status
Source
Language