asvela/keyoscacquire

View on GitHub

Showing 3 of 4 total issues

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

def obtain_instrument_information(resource_manager, address, num,
                                  ask_idn=True, timeout=200):
    """Obtain more information about a VISA resource

    Parameters
Severity: Minor
Found in keyoscacquire/visa_utils.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 _load_trace_with_header has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def _load_trace_with_header(fname, ext, skip_lines='auto', column_names='auto',
                            return_as_df=True):
    """Read a trace file that has a header (i.e. not ``.npy`` files).

    See parameter description for :func:`load_trace()`.
Severity: Minor
Found in keyoscacquire/fileio.py - About 45 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 save_trace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def save_trace(fname, time, y, fileheader="", ext=config._filetype,
               print_filename=True, nowarn=False):
    """Saves the trace with time values and y values to file.

    Current date and time is automatically added to the header. Saving to numpy
Severity: Minor
Found in keyoscacquire/fileio.py - About 35 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