ulikoehler/UliEngineering

View on GitHub
UliEngineering/SignalProcessing/FFT.py

Summary

Maintainability
B
5 hrs
Test Coverage

Function fft_cut_dc_artifacts has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def fft_cut_dc_artifacts(fft, return_idx=False):
    """
    If an FFT contains DC artifacts, i.e. a large value in the first FFT samples,
    this function can be used to remove this area from the FFT value set.
    This function cuts every value up to (but not including the) first local minimum.
Severity: Minor
Found in UliEngineering/SignalProcessing/FFT.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 parallel_fft_reduce has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

def parallel_fft_reduce(chunkgen, samplerate, fftsize, removeDC=False, window="blackman", reducer=sum_reducer, normalize=True, executor=None):
Severity: Major
Found in UliEngineering/SignalProcessing/FFT.py - About 1 hr to fix

    Function serial_fft_reduce has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def serial_fft_reduce(chunkgen, samplerate, fftsize, removeDC=False, window="blackman", reducer=sum_reducer, normalize=True, window_param=None):
    Severity: Major
    Found in UliEngineering/SignalProcessing/FFT.py - About 1 hr to fix

      Function __getitem__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def __getitem__(self, arg):
              """
              Select a frequency range:
              fft[1.0:100.0] selects the 1.0 ... 100.0 Hz frequency range
              fft[1.0:] selects everything from 1.0 Hz to the max frequency
      Severity: Minor
      Found in UliEngineering/SignalProcessing/FFT.py - About 55 mins 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 simple_fft_reduce has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def simple_fft_reduce(fn, arr, samplerate, fftsize, shiftsize=None, nthreads=4, **kwargs):
      Severity: Major
      Found in UliEngineering/SignalProcessing/FFT.py - About 50 mins to fix

        Function __fft_reduce_worker has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def __fft_reduce_worker(chunkgen, i, window, fftsize, removeDC):
        Severity: Minor
        Found in UliEngineering/SignalProcessing/FFT.py - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status