Showing 50 of 67 total issues
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 create_desktop
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_desktop(desktop_file=None, desktop_file_name="guiscrcpy.desktop"):
"""
Create Desktop filename for Linux in ~/.local level
: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 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 get_dimensions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_dimensions(self, device_id=None):
shell_adb = _get_dimension_raw_noexcept(path=self.path, device_id=device_id)
try:
if shell_adb.wait(timeout=3) != 0:
self.logger.warning(
- 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 run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(self, device_id=None):
if device_id is None:
command = [self.get_path()]
else:
command = [self.get_path(), 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 is_running
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def is_running(process_name):
if psutil_present:
# Iterate over the all the running process
for proc in psutil.process_iter():
try:
- 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 cli
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def cli(
ctx: Context,
hide_wm_frame: bool = True,
aot: bool = True,
theme: str = "Breeze",
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function check_orientation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_orientation(self):
proc = self.adb.shell("dumpsys input")
try:
e_code = proc.wait(5)
except subprocess.TimeoutExpired:
- 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 os.path.exists(os.path.join(j, filename + append)):
return [os.path.join(j, filename + append)]
else:
Avoid deeply nested control flow statements. Open
for exe in filename:
if os.path.exists(os.path.join(j, exe + append)):
return [os.path.join(j, exe + append)]
else:
Function bootstrap
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def bootstrap(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, parent, device_id, adb, initialize=True, config_path=None):
Function cli
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def cli(
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 False
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return False