srevinsaju/guiscrcpy

View on GitHub

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
Severity: Minor
Found in guiscrcpy/launcher.py - About 1 hr 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 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:
        """
Severity: Minor
Found in guiscrcpy/platform/linux.py - About 1 hr 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 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:
Severity: Minor
Found in guiscrcpy/launcher.py - About 1 hr 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_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(
Severity: Minor
Found in guiscrcpy/lib/bridge/adb.py - About 1 hr 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 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:
        """
Severity: Minor
Found in guiscrcpy/launcher.py - About 1 hr to fix

    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]
    Severity: Minor
    Found in guiscrcpy/lib/bridge/audio/sndcpy.py - About 55 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 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:
    Severity: Minor
    Found in guiscrcpy/lib/process.py - About 55 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 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",
    Severity: Minor
    Found in guiscrcpy/cli.py - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in guiscrcpy/launcher.py - About 50 mins to fix

      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:
      Severity: Minor
      Found in guiscrcpy/lib/mapper/mapper.py - About 45 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

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

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

          Function bootstrap has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def bootstrap(
          Severity: Minor
          Found in guiscrcpy/launcher.py - About 45 mins to fix

            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Minor
            Found in guiscrcpy/lib/mapper/ux.py - About 35 mins to fix

              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(self, parent, device_id, adb, initialize=True, config_path=None):
              Severity: Minor
              Found in guiscrcpy/lib/mapper/mapper.py - About 35 mins to fix

                Function cli has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def cli(
                Severity: Minor
                Found in guiscrcpy/cli.py - About 35 mins to fix

                  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 = ""
                  Severity: Minor
                  Found in guiscrcpy/launcher.py - About 35 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

                  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
                        Severity
                        Category
                        Status
                        Source
                        Language