sbank/waveforms.py
AlignedSpinTemplate
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class AlignedSpinTemplate(object):
"""
Base class that handles whitening, normalization, and
zero-padding/unpadding. Derived classes should:
Function __init__
has 16 arguments (exceeds 8 allowed). Consider refactoring. Open
Open
def __init__(self, m1, m2, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
Function create_moments
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_moments(df, flow, len_PSD):
# moments go from flow to fmax unlike the PSD, which starts at 0
n = len_PSD - int(flow / df)
momI_0 = lal.CreateREAL8Vector(n)
momI_2 = lal.CreateREAL8Vector(n)
Function __init__
has 13 arguments (exceeds 8 allowed). Consider refactoring. Open
Open
def __init__(self, m1, m2, spin1x, spin1y, spin1z,
Function __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def __init__(self, *args, **kwargs):
llwsit.__init__(self, *args, **kwargs)
for entry in _sit_cols.keys():
if not hasattr(self, entry):
if _sit_cols[entry] in ['real_4', 'real_8']:
- Read upRead up
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
FIXME found Open
Open
# may want to FIXME if that changes
- Exclude checks
FIXME found Open
Open
# may want to FIXME if that changes
- Exclude checks
FIXME found Open
Open
# FIXME: Is a minimal time of 1.0s too long?
- Exclude checks
FIXME found Open
Open
# may want to FIXME if that changes
- Exclude checks
FIXME found Open
Open
# FIXME: Using alpha columns to hold theta, phi, iota, psi
- Exclude checks
FIXME found Open
Open
# FIXME: Using alpha columns to hold theta, phi, iota, psi
- Exclude checks