ulikoehler/UliEngineering

View on GitHub

Showing 64 of 64 total issues

Function unstair has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def unstair(x, y, method="diff", tolerance=1e-9):
    """
    Remove stairs (adjacent equal values) from a function with quantized values.
    The first and the last values are always returned.

Severity: Minor
Found in UliEngineering/SignalProcessing/Utils.py - About 25 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 yield_seconds_on_day has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def yield_seconds_on_day(year=2022, month=6, day=15, tz=None):
    """
    For each second on the given day in the given timezone,
    yield a Python datetime object representing this timestamp.

Severity: Minor
Found in UliEngineering/Utils/Date.py - About 25 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 skip_first has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def skip_first(it):
    """
    Skip the first element of an Iterator or Iterable,
    like a Generator or a list.

Severity: Minor
Found in UliEngineering/Utils/Iterable.py - About 25 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 select_by_datetime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def select_by_datetime(timestamps, time, factor=1.0, around=None, ofs=0.0, side="left"):
    """
    Find the index in a timestamp array that is closest to a given value.
    The timestamp array expected to be sorted in ascending order. It is
    expected to contain Epoch timestamps as either integral or floating-point type.
Severity: Minor
Found in UliEngineering/SignalProcessing/Selection.py - About 25 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

Severity
Category
Status
Source
Language