Showing 88 of 341 total issues
Function _send_and_receive
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _send_and_receive(self, target, lun, netfn, cmdid, payload):
Function send_platform_event
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_platform_event(self, sensor_type, sensor_number, event_type,
Function i2c_read
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def i2c_read(self, bus_type, bus_id, channel, address, count):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, slave_address=0x81, host_target_address=0x20,
Function partial_add_sdr
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def partial_add_sdr(self, reservation_id, record_id,
Function send_channel_power
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_channel_power(self, channel, enable, current_limit, primary_pm=1, backup_pm=0):
Function i2c_write
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def i2c_write(self, bus_type, bus_id, channel, address, data):
Function _clear_repository
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _clear_repository(reserve_fn, clear_fn, ctrl, retry, reservation):
Function _send_and_receive
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _send_and_receive(self, target, lun, netfn, cmdid, payload):
Function _decode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _decode(self, data):
"""Decode the bytestring message."""
if not hasattr(self, '__fields__'):
return
- Read upRead up
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 preparation_stage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def preparation_stage(self, image):
####################################################
# match device ID, manfuacturer ID, etc.
device_id = self.get_device_id()
- Read upRead up
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 boot_options_to_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def boot_options_to_data(boot_device, boot_mode, boot_persistency):
"""
Convert a boot mode (string), boot device (string) and boot persistency (bool)
into a `SetSystemBootOptions(BOOT_PARAMETER_BOOT_FLAGS)` request data.
"""
- Read upRead up
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 from_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def from_data(component_id, data):
if isinstance(data, str):
data = [ord(c) for c in data]
if component_id is PROPERTY_GENERAL_PROPERTIES:
- Read upRead up
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 send_message
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def send_message(self, req, retry=3):
req.target = self.target
req.requester = self.requester
rsp = None
- Read upRead up
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 convert_sensor_raw_to_value
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def convert_sensor_raw_to_value(self, raw):
if raw is None:
return None
fmt = self.analog_data_format
if (fmt == self.DATA_FMT_1S_COMPLEMENT):
- Read upRead up
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 _from_response
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _from_response(self, rsp):
self.device_id = rsp.device_id
self.revision = rsp.device_revision.device_revision
self.provides_sdrs = bool(rsp.device_revision.provides_device_sdrs)
self.available = bool(rsp.firmware_revision.device_available)
- Read upRead up
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 to_request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_request(self, req):
req.fru_id = self.fru_id
req.led_id = self.led_id
req.color = self.override_color
- Read upRead up
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 ComponentPropertyDeferredVersion(data)
Function get_command_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_command_list():
data = list()
Command = namedtuple('Command', ['netfn', 'cmdid', 'grpext', 'name'])
od = OrderedDict(sorted(DEFAULT_REGISTRY.registry.items()))
- Read upRead up
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 _receive_raw
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _receive_raw(self, header):
start_time = time.time()
rsp_received = False
poll_returned_no_data = False
while not rsp_received:
- Read upRead up
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"