gwastro/sbank

View on GitHub
sbank/waveforms.py

Summary

Maintainability
C
7 hrs
Test Coverage

AlignedSpinTemplate has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

class AlignedSpinTemplate(object):
    """
    Base class that handles whitening, normalization, and
    zero-padding/unpadding. Derived classes should:

Severity: Minor
Found in sbank/waveforms.py - About 2 hrs to fix

    Function __init__ has 16 arguments (exceeds 8 allowed). Consider refactoring.
    Open

        def __init__(self, m1, m2, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
    Severity: Major
    Found in sbank/waveforms.py - About 1 hr to fix

      Function create_moments has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      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)
      Severity: Minor
      Found in sbank/waveforms.py - About 1 hr to fix

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

            def __init__(self, m1, m2, spin1x, spin1y, spin1z,
        Severity: Major
        Found in sbank/waveforms.py - About 1 hr to fix

          Function __init__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          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']:
          Severity: Minor
          Found in sbank/waveforms.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

          FIXME found
          Open

                  # may want to FIXME if that changes
          Severity: Minor
          Found in sbank/waveforms.py by fixme

          FIXME found
          Open

                  # may want to FIXME if that changes
          Severity: Minor
          Found in sbank/waveforms.py by fixme

          FIXME found
          Open

                  # FIXME: Is a minimal time of 1.0s too long?
          Severity: Minor
          Found in sbank/waveforms.py by fixme

          FIXME found
          Open

                  # may want to FIXME if that changes
          Severity: Minor
          Found in sbank/waveforms.py by fixme

          FIXME found
          Open

                  # FIXME: Using alpha columns to hold theta, phi, iota, psi
          Severity: Minor
          Found in sbank/waveforms.py by fixme

          FIXME found
          Open

                  # FIXME: Using alpha columns to hold theta, phi, iota, psi
          Severity: Minor
          Found in sbank/waveforms.py by fixme

          There are no issues that match your filters.

          Category
          Status