Showing 88 of 341 total issues
Function set_user_access
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_user_access(self, userid, ipmi_msg, link_auth, callback_only,
Function get_sdr_chunk_helper
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_sdr_chunk_helper(send_fn, req, reserve_fn, retry=5):
while True:
retry -= 1
if retry == 0:
- 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 __str__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __str__(self):
string = '[flags '
string += self.local_state_available and ' LOCAL_STATE' or ''
string += self.override_enabled and ' OVR_EN' or ''
string += self.lamp_test_enabled and ' LAMP_TEST_EN' or ''
- 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 _build_ipmitool_target
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _build_ipmitool_target(target):
cmd = ''
if target is None:
return ''
if target.routing is not 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 register_class
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def register_class(self, cls):
# some sanity checks
# (1) class name has to end in Req or Rsp
if cls.__name__[-3:] not in ('Req', 'Rsp'):
raise DescriptionError('Class name has to end in Req or Rsp')
- 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 get_component_properties
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_component_properties(self, component_id):
properties = []
for p in (PROPERTY_GENERAL_PROPERTIES, PROPERTY_CURRENT_VERSION,
PROPERTY_DESCRIPTION_STRING, PROPERTY_ROLLBACK_VERSION,
PROPERTY_DEFERRED_VERSION):
- 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 deeply nested control flow statements. Open
if not rx_data:
# the forwarded reply is expected in the next packet
# so we do not increment the retry counter as
# it's not really a retry
continue
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, slave_address=0x20, port=0, serial_number=None,
Function encode_send_message
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def encode_send_message(payload, rq_sa, rs_sa, channel, seq, tracking=1):
Function i2c_write_read
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def i2c_write_read(self, bus_type, bus_id, channel, address, count,
Function convert_sensor_value_to_raw
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def convert_sensor_value_to_raw(self, value):
linearization = self.linearization & 0x7f
if linearization is not L_LINEAR:
raise NotImplementedError()
- 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_rsp_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _from_rsp_data(self, data):
support = []
cap = data[0]
if cap & self.ROLLBACK_SUPPORT_MASK == 0:
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def _from_response(self, rsp):
self.channel = rsp.channel_number
self.auth_types = []
self.ipmi_1_5 = False
- 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 main
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def main(args=None):
parser = argparse.ArgumentParser(description="IPMI server emulation.")
parser.add_argument("-p", "--port", type=int, dest="port", help="RMCP port", default=623)
parser.add_argument("-c", "--config", type=str, dest="config", help="Config file")
parser.add_argument(
- 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 _clear_repository
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _clear_repository(reserve_fn, clear_fn, ctrl, retry, reservation):
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 get_lan_config_param
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_lan_config_param(self, channel=0, parameter_selector=0,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, rsp=None, fru_id=None, led_id=None, color=None,
Function create
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def create(self, netfn, cmdid, group_extension, *args, **kwargs):
Function _send_and_receive
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _send_and_receive(self, target, lun, netfn, cmdid, payload):