Showing 50 of 67 total issues
Avoid too many return
statements within this function. Open
return "/snap/bin/guiscrcpy"
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
Function show_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show_version(ctx, param, value): # noqa:
"""Prints the version of the utility"""
if not value or ctx.resilient_parsing:
return
click.echo(fc("{g}guiscrcpy {rst}v{v}", v=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
Function wmctrl_xdotool_linux_send_key
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wmctrl_xdotool_linux_send_key(key):
assert isinstance(key, str)
assert System.system() == "Linux"
wmctrl = shutil.which("wmctrl")
xdotool = shutil.which("xdotool")
- 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 on_key_press
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def on_key_press(self, key):
try:
if key.char in self.config.keys():
print("[KEY] Hotkey command executing")
position_to_tap = self.config.get(key.char)
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def init(self):
if platform.system() != "Linux" or (
shutil.which("wmctrl")
and shutil.which("xdotool")
and platform.system() == "Linux"
- 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 map_network
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def map_network(self, pool_size=255):
"""
Maps the network
:param pool_size: amount of parallel ping processes
:return: list of valid ip addresses
- 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 update_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_config(self, new_conf):
for i in new_conf:
for j in self.config:
if i == j:
self.config[i] = new_conf[i]
- 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_self
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_self():
"""
Returns the path to the running executable depending on the conditions
:return:
:rtype:
- 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"