File launcher.py
has 1048 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
"""
GUISCRCPY by srevinsaju
Get it on : https://github.com/srevinsaju/guiscrcpy
Function scan_devices_update_list_view
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def scan_devices_update_list_view(self):
"""
Scan for new devices; and update the list view
: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
InterfaceGuiscrcpy
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class InterfaceGuiscrcpy(QMainWindow, Ui_MainWindow):
"""
Main class for guiscrcpy object.
All the processes to spawn to scrcpy are handled here
Function __init__
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
config_manager: InterfaceConfig,
adb: AndroidDebugBridge,
scrcpy: ScrcpyBridge,
- 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 start_act
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def start_act(self):
"""
Main brain of guiscrcpy; handles what to do when
: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 check_devices_status_and_select_first_if_only_one
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def check_devices_status_and_select_first_if_only_one(self, values_devices_list):
"""
Checks the devices in the Grid View, and then checks if any device
is available or offline accordingly display the error message. If
only one device was detected, automatically select the first device
- 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 __init__
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
config_manager: InterfaceConfig,
adb: AndroidDebugBridge,
scrcpy: ScrcpyBridge,
Function create_desktop_shortcut_linux_os
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create_desktop_shortcut_linux_os(self) -> bool:
"""
Creates a desktop shortcut for Linux OS
:return: bool
"""
- 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 remove_device_device_view
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def remove_device_device_view(self, identifier: str = "", statuses=()):
"""
Removes all QListWidgetItems from the device_view for all matching
identifier
:param identifier: str
- 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 ping_paired_device
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def ping_paired_device(self, device_id=None):
# update the configuration file first
if not device_id:
_, identifier = self.current_device_identifier()
if identifier.count(".") == 3:
- 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 start_act
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_act(self):
"""
Main brain of guiscrcpy; handles what to do when
:return:
"""
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function bootstrap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def bootstrap(
Function tcpip_paired_device
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def tcpip_paired_device(self):
if self.devices_view.currentItem():
_, identifier = self.current_device_identifier()
else:
identifier = ""
- 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 0
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return device_id, more_devices, _stat