ulikoehler/UliEngineering

View on GitHub
UliEngineering/SignalProcessing/Window.py

Summary

Maintainability
A
2 hrs
Test Coverage

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

def create_window(size, window_id="blackman", param=None):
    """
    Create a new window numpy array
    param is only used for some windows.

Severity: Minor
Found in UliEngineering/SignalProcessing/Window.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

Avoid too many return statements within this function.
Open

        return window_id(size, param)
Severity: Major
Found in UliEngineering/SignalProcessing/Window.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return np.ones(size)
    Severity: Major
    Found in UliEngineering/SignalProcessing/Window.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return np.kaiser(size, 2.0 if param is None else param)
      Severity: Major
      Found in UliEngineering/SignalProcessing/Window.py - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status