TrishGillett/pysdpt3glue

View on GitHub
sdpt3glue/result.py

Summary

Maintainability
B
5 hrs
Test Coverage

Function extract_X has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

def extract_X(msg):
    '''
    Given the output message from running SDPT3solve.m, reconstruct the X
    matrix from the printed output and return it.
    '''
Severity: Minor
Found in sdpt3glue/result.py - About 4 hrs 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 deeply nested control flow statements.
Open

                    for k, item in enumerate(re.split(r'\s+', line)):
                        Xlist[i][row, col_start + k] = float(item)
            print "Imported X[{0}] as a matrix with shape {1}.".format(i, Xlist[i].shape)
Severity: Major
Found in sdpt3glue/result.py - About 45 mins to fix

    Function handle_msg_item has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    def handle_msg_item(x):
        '''
        A function that takes a string x and returns it's interpretation as an int,
        float, or string in that order of preference.  If x is None, None is
        returned.
    Severity: Minor
    Found in sdpt3glue/result.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

    There are no issues that match your filters.

    Category
    Status