Showing 218 of 305 total issues
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.
#
- Create a ticketCreate a ticket
File core.py
has 1294 lines of code (exceeds 1000 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) Louisiana State University (2014-2017)
# Cardiff University (2017-2021)
#
# This file is part of GWpy.
- Create a ticketCreate a ticket
File flag.py
has 1263 lines of code (exceeds 1000 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Copyright (C) Louisiana State University (2014-2017)
# Cardiff University (2017-2023)
#
# This file is part of GWpy.
- Create a ticketCreate a ticket
DataQualityFlag
has 54 functions (exceeds 20 allowed). Consider refactoring. Open
class DataQualityFlag(object):
"""A representation of a named set of segments.
Parameters
----------
- Create a ticketCreate a ticket
Function append
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def append(self, other, inplace=True, pad=None, gap=None, resize=True):
"""Connect another series onto the end of the current one.
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 ex2rst
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def ex2rst(infile):
"""Convert a Python example script into RST
Returns
-------
- 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
Channel
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class Channel(object):
"""Representation of a laser-interferometer data channel.
Parameters
----------
- Create a ticketCreate a ticket
Series
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class Series(Array):
"""A one-dimensional data series
A `Series` is defined as an array of data indexed upon an axis, meaning
each sample maps to a position upon the axis. By convention the X axis
- Create a ticketCreate a ticket
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
- 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
TimeSeries
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class TimeSeries(TimeSeriesBase):
"""A time-domain data array.
Parameters
----------
- Create a ticketCreate a ticket
Function from_ligolw_tables
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def from_ligolw_tables(cls, segmentdeftable, segmentsumtable,
segmenttable, names=None, gpstype=LIGOTimeGPS,
on_missing='error'):
"""Build a `DataQualityDict` from a set of LIGO_LW segment tables
- 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 kinit
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def kinit(
username=None,
password=None,
realm=None,
exe="kinit",
- 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_gwf
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def read_gwf(filename, channels, start=None, end=None, scaled=None,
ctype=None, series_class=TimeSeries):
"""Read a dict of series data from a single GWF file
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
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def fetch(channels, start, end, type=None, dtype=None, allow_tape=None,
connection=None, host=None, port=None, pad=None, scaled=True,
verbose=False, series_class=TimeSeries):
# host and port keywords are used by the decorator only
# pylint: disable=unused-argument
- 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
Array
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Array(Quantity):
"""Array holding data with a unit, and other metadata
This `Array` holds the input data and a standard set of metadata
properties associated with GW data.
- Create a ticketCreate a ticket
Function find
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def find(cls, channels, start, end, frametype=None,
frametype_match=None, pad=None, scaled=None, nproc=1,
verbose=False, allow_tape=True, observatory=None, **readargs):
"""Find and read data from frames for a number of channels.
- 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
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def fetch(cls, channels, start, end, host=None, port=None,
verify=False, verbose=False, connection=None,
pad=None, scaled=None, allow_tape=None, type=None,
dtype=None):
"""Fetch data from NDS for a number of channels.
- 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
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def read(cls, source, names=None, format=None, **kwargs):
"""Read segments from file into a `DataQualityDict`
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 multiprocess_with_queues
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def multiprocess_with_queues(nproc, func, inputs, verbose=False,
**progress_kw):
"""Map a function over a list of inputs using multiprocess
This essentially duplicates `multiprocess.map` but allows for
- 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 populate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def populate(self, source=DEFAULT_SEGMENT_SERVER,
segments=None, pad=True, on_error='raise', **kwargs):
"""Query the segment database for each flag's active segments.
This method assumes all of the metadata for each flag have been
- 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"