Showing 218 of 305 total issues
Function __new__
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def __new__(cls, value, unit=None, x0=None, dx=None, xindex=None,
xunit=None, **kwargs):
# check input data dimensions are OK
shape = numpy.shape(value)
if len(shape) != cls._ndim:
- Read upRead up
- Create a ticketCreate a ticket
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_gwosc_data_file
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _fetch_gwosc_data_file(url, *args, **kwargs):
"""Fetch a single GWOSC file and return a `Series`.
"""
cls = kwargs.pop('cls', TimeSeries)
cache = kwargs.pop('cache', None)
- Read upRead up
- Create a ticketCreate a ticket
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_axis_properties
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _set_axis_properties(self, axis):
"""Generic method to set properties for X/Y axis
on a specific subplot
"""
def _get(param):
- Read upRead up
- Create a ticketCreate a ticket
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_spectrogram
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def from_spectrogram(cls, *spectrograms, **kwargs):
"""Calculate a new `SpectralVariance` from a
:class:`~gwpy.spectrogram.Spectrogram`
Parameters
- Read upRead up
- Create a ticketCreate a ticket
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_channel_list_file
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def read_channel_list_file(*source):
"""Read a `~gwpy.detector.ChannelList` from a Channel List File
"""
# read file(s)
config = configparser.ConfigParser(dict_type=OrderedDict)
- Read upRead up
- Create a ticketCreate a ticket
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 scale_axes_from_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def scale_axes_from_data(self):
"""Restrict data limits for Y-axis based on what you can see
"""
# get tight limits for X-axis
if self.args.xmin is None:
- Read upRead up
- Create a ticketCreate a ticket
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 __new__
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def __new__(cls, data, unit=None,
x0=None, dx=None, xindex=None, xunit=None,
y0=None, dy=None, yindex=None, yunit=None, **kwargs):
"""Define a new `Array2D`
"""
- Read upRead up
- Create a ticketCreate a ticket
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
Array2D
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Array2D(Series):
"""A two-dimensional array with metadata
Parameters
----------
- Create a ticketCreate a ticket
Function _get_unit
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _get_unit(cls, t):
# match as normal
try:
return cls._parse_unit(t.value)
except ValueError as exc:
- Read upRead up
- Create a ticketCreate a ticket
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_frdata
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def read_frdata(frdata, epoch, start, end, scaled=True,
series_class=TimeSeries):
"""Read a series from an `FrData` structure
Parameters
- Read upRead up
- Create a ticketCreate a ticket
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_gwosc_data
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def fetch_gwosc_data(detector, start, end, cls=TimeSeries, **kwargs):
"""Fetch GWOSC data for a given detector
This function is for internal purposes only, all users should instead
use the interface provided by `TimeSeries.fetch_open_data` (and similar
- Read upRead up
- Create a ticketCreate a ticket
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_veto_definer_file
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def from_veto_definer_file(cls, fp, start=None, end=None, ifo=None,
format='ligolw'):
"""Read a `DataQualityDict` from a LIGO_LW XML VetoDefinerTable.
Parameters
- Read upRead up
- Create a ticketCreate a ticket
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 strip_ilwdchar
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def strip_ilwdchar(_ContentHandler):
"""Wrap a LIGO_LW content handler to swap ilwdchar for int on-the-fly
when reading a document
This is adapted from :func:`ligo.skymap.utils.ilwd`, copyright
- Read upRead up
- Create a ticketCreate a ticket
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 _match_array
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _match_array(xmldoc, name=None, epoch=None, **params):
from ligo.lw.ligolw import Array
from ligo.lw.param import (Param, get_param)
def _is_match(arr):
- Read upRead up
- Create a ticketCreate a ticket
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
TimeSeriesBase
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class TimeSeriesBase(Series):
"""An `Array` with time-domain metadata.
Parameters
----------
- Create a ticketCreate a ticket
DataQualityDict
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class DataQualityDict(OrderedDict):
"""An `~collections.OrderedDict` of (key, `DataQualityFlag`) pairs.
Since the `DataQualityDict` is an `OrderedDict`, all iterations over
its elements retain the order in which they were inserted.
- Create a ticketCreate a ticket
Function sieve
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def sieve(self, name=None, sample_rate=None, sample_range=None,
exact_match=False, **others):
"""Find all `Channels <Channel>` in this list matching the
specified criteria.
- Read upRead up
- Create a ticketCreate a ticket
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 __call__
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self):
"""Return the locations of the ticks
"""
majorlocs = self.axis.get_majorticklocs()
trans = self.axis.get_transform()
- Read upRead up
- Create a ticketCreate a ticket
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 hist
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def hist(self, x, *args, **kwargs):
x = numpy.asarray(x)
# re-format weights as array if given as float
weights = kwargs.get('weights', None)
- Read upRead up
- Create a ticketCreate a ticket
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 identify_with_list
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def identify_with_list(identifier):
"""Decorate an I/O identifier to handle a list of files as input
This function tries to resolve a single file path as a `str` from any
file-like or collection-of-file-likes to pass to the underlying
- Read upRead up
- Create a ticketCreate a ticket
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"