srevinsaju/guiscrcpy

View on GitHub

Showing 50 of 67 total issues

Avoid too many return statements within this function.
Open

            return False
Severity: Major
Found in guiscrcpy/lib/utils.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return 0
    Severity: Major
    Found in guiscrcpy/launcher.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return False
      Severity: Major
      Found in guiscrcpy/lib/utils.py - About 30 mins to fix

        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]
        Severity: Minor
        Found in guiscrcpy/lib/config.py - About 25 mins to fix

        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
        Severity: Minor
        Found in guiscrcpy/network/network.py - About 25 mins to fix

        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)
        Severity: Minor
        Found in guiscrcpy/lib/mapper/mapper.py - About 25 mins to fix

        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 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))
        Severity: Minor
        Found in guiscrcpy/cli.py - About 25 mins to fix

        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"
        Severity: Minor
        Found in guiscrcpy/ux/toolkit.py - About 25 mins to fix

        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:
        Severity: Minor
        Found in guiscrcpy/lib/utils.py - About 25 mins to fix

        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")
        Severity: Minor
        Found in guiscrcpy/lib/toolkit.py - About 25 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language