Showing 41 of 43 total issues
Function get_firmware_command
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_firmware_command(self, module_id: int, rot_stype: int,
Function __update_map
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __update_map(self, module_id: int, x: int, y: int, prev_id: int,
Function send_firmware_command
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_firmware_command(self, oper_type: str, module_id: int,
Function __find_modi_device
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __find_modi_device(self):
scanner = pexpect.spawn('sudo hcitool lescan')
init_time = time.time()
devices = []
while time.time() - init_time < 1:
- 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_pkt
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __send_pkt(self, pkt, wait=True, timeout=None, continuous=False):
Function send_firmware_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_firmware_data(self, module_id: int, seq_num: int, bin_data: bytes,
Function __add_new_module
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __add_new_module(
Function send_firmware_data
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_firmware_data(self, module_id: int, seq_num: int, bin_data: bytes,
Function __init_task
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init_task(
Function __write_chunk
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __write_chunk(self, chunk, curr_seq, total_seq, manager):
Function open_conn
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def open_conn(self) -> None:
""" Open serial port
:return: 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 __ble_read
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __ble_read(self):
"""
handle -- integer, characteristic read handle the data was received on
value -- bytearray, the data returned in the notification
"""
- 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 __compose_line
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __compose_line(self, module_id, padding, print_id):
line = ""
if not module_id:
line += " " * padding
else:
- 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 __check_modules
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __check_modules(bundle):
module_names = [type(module).__name__ for module in bundle.modules]
expected_names = ["Button", "Dial", "Led", "Speaker", "Display"]
if len(module_names) != len(expected_names):
return 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
Avoid too many return
statements within this function. Open
return im(mod_path).BleTask(verbose, network_uuid)
Function initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(display: Display, led: Led, speaker: Speaker,
dial: Dial) -> int:
"""Initialize the movment of the ball
:param display: Display module
- 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 __encode_bytes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __encode_bytes(byte_data: Tuple):
idx = 0
data = bytearray(len(byte_data))
while idx < len(byte_data):
if not byte_data[idx]:
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
width, height = 930, 790
window = Tk()
window.title(f"GUI Debugger for PyMODI (v{modi.__version__})")
window.geometry(f"{width}x{height}")
- 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 __query_log
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __query_log(self, line: str) -> bool:
if ('recv' not in line and 'send' not in line) or \
(self.__curr_module and str(self.__curr_module.id) not in line
and self.__curr_module.module_type != 'network') \
or (self.__curr_cmd and f'"c":{self.__curr_cmd},' not in line):
- 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 check_option
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_option(*options):
for o, a in opts:
if o in options:
return a if a else True
return 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"