nigroup/nideep

View on GitHub
nideep/iow/test_read_lmdb.py

Summary

Maintainability
D
1 day
Test Coverage

File test_read_lmdb.py has 366 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'''
Created on Oct 30, 2015

@author: kashefy
'''
Severity: Minor
Found in nideep/iow/test_read_lmdb.py - About 4 hrs to fix

    Function test_read_values_pixels_with_labels has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def test_read_values_pixels_with_labels(self, mock_dat):
    
            # mocks
            dstr = ['\x01\x04\x07\n\r\x10\x13\x16\x02\x05\x08\x0b\x0e\x11\x14\x17\x03\x06\t\x0c\x0f\x12\x15\x18',
                    '\x10\x16\x11\x17\x12\x18']
    Severity: Minor
    Found in nideep/iow/test_read_lmdb.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 test_read_values_float has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def test_read_values_float(self, mock_dat):
    
            img2_data = self.img1_data[2:, 1:, :]
    
            # mocks
    Severity: Minor
    Found in nideep/iow/test_read_lmdb.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 test_read_values_pixels_no_labels has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def test_read_values_pixels_no_labels(self, mock_dat):
    
            # expected content: img1_data, img1_data[2:,1:,:]
    
            # mocks
    Severity: Minor
    Found in nideep/iow/test_read_lmdb.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 test_read_values_at has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def test_read_values_at(self, mock_dat):
    
            # mocks
            dstr = ['\x01\x04\x07\n\r\x10\x13\x16\x02\x05\x08\x0b\x0e\x11\x14\x17\x03\x06\t\x0c\x0f\x12\x15\x18',
                    '\x10\x16\x11\x17\x12\x18']
    Severity: Minor
    Found in nideep/iow/test_read_lmdb.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 test_read_values has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def test_read_values(self, mock_dat):
    
            img2_data = self.img1_data[2:, 1:, :]
    
            # mocks
    Severity: Minor
    Found in nideep/iow/test_read_lmdb.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 test_read_values_pixels_with_labels_uint8 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def test_read_values_pixels_with_labels_uint8(self, mock_dat):
    
            # mocks
            dstr = ['\x01\x04\x07\n\r\x10\x13\x16\x02\x05\x08\x0b\x0e\x11\x14\x17\x03\x06\t\x0c\x0f\x12\x15\x18',
                    '\x10\x16\x11\x17\x12\x18']
    Severity: Minor
    Found in nideep/iow/test_read_lmdb.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 test_read_values_at_key_string has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def test_read_values_at_key_string(self, mock_dat):
    
            # mocks
            dstr = ['\x01\x04\x07\n\r\x10\x13\x16\x02\x05\x08\x0b\x0e\x11\x14\x17\x03\x06\t\x0c\x0f\x12\x15\x18',
                    '\x10\x16\x11\x17\x12\x18']
    Severity: Minor
    Found in nideep/iow/test_read_lmdb.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

    There are no issues that match your filters.

    Category
    Status