srevinsaju/guiscrcpy

View on GitHub

Showing 50 of 67 total issues

File style.py has 1354 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
GUISCRCPY by srevinsaju
Get it on : https://github.com/srevinsaju/guiscrcpy
Licensed under GNU Public License

Severity: Major
Found in guiscrcpy/theme/style.py - About 3 days to fix

    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
    Severity: Major
    Found in guiscrcpy/launcher.py - About 2 days to fix

      File desktop_shortcut.py has 443 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env/python\n
      # flake8: noqa
      def desktop_device_shortcut_svg():
          a = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <svg
      Severity: Minor
      Found in guiscrcpy/theme/desktop_shortcut.py - About 6 hrs to fix

        Function check_existence has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

        def check_existence(paths, filename="", directory=True, path=False):
            for i in paths:
                j = os.path.expanduser(i)
                if os.path.exists(j):  # directory exists
                    if directory and os.path.isdir(j):
        Severity: Minor
        Found in guiscrcpy/lib/utils.py - About 6 hrs 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 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:
                """
        Severity: Minor
        Found in guiscrcpy/launcher.py - About 4 hrs 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 connect has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def connect(self):
                try:
                    ip = self.listView.currentItem().text()
                except AttributeError:
                    # The IP Address in the ListView has precedence over the IP address
        Severity: Minor
        Found in guiscrcpy/ux/network.py - About 3 hrs 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

        File cli.py has 309 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import os
        import platform
        import sys
        import traceback
        
        
        Severity: Minor
        Found in guiscrcpy/cli.py - About 3 hrs to fix

          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
          Severity: Minor
          Found in guiscrcpy/launcher.py - About 2 hrs to fix

            Function __init__ has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                def __init__(
                    self,
                    config_manager: InterfaceConfig,
                    adb: AndroidDebugBridge,
                    scrcpy: ScrcpyBridge,
            Severity: Minor
            Found in guiscrcpy/launcher.py - About 2 hrs 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 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:
                    """
            Severity: Minor
            Found in guiscrcpy/launcher.py - About 2 hrs 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 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def __init__(self, ux_wrapper=None, frame=False, always_on_top=True):
                    """
                    Swipe UI
                    :param ux_wrapper: UXMapper type object
                    :param frame: bool
            Severity: Major
            Found in guiscrcpy/ux/swipe.py - About 2 hrs to fix

              Function complete has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  def complete(self):
                      x = []
                      for i in self.checkboxes:
                          if i.isChecked():
                              box = self.checkboxes[i]
              Severity: Minor
              Found in guiscrcpy/ux/settings.py - About 2 hrs 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 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
              Severity: Minor
              Found in guiscrcpy/launcher.py - About 2 hrs 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 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def __init__(
                      self,
                      config_manager: InterfaceConfig,
                      adb: AndroidDebugBridge,
                      scrcpy: ScrcpyBridge,
              Severity: Major
              Found in guiscrcpy/launcher.py - About 2 hrs to fix

                Function mapper has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                def mapper(device_id=None, reset=False):
                    """Run the guiscrcpy mapper"""
                    config_manager = InterfaceConfig()
                    config = config_manager.get_config()
                    mapper_cfg_path = os.path.join(
                Severity: Minor
                Found in guiscrcpy/cli.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_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
                        """
                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 build_user_interface has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def build_user_interface(self):
                        self.label = QtWidgets.QLabel(self)
                        self.drawing = False
                        self.widget = QtWidgets.QWidget(self)
                        self.widget.setGeometry(QtCore.QRect(0, 0, 351, 34))
                Severity: Minor
                Found in guiscrcpy/lib/mapper/ux.py - About 1 hr to fix

                  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 quit_window has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def quit_window(self):
                          for instance in self.parent.child_windows:  # noqa
                              # We are checking for any more windows running before killing
                              # the main window. self.child_windows has the list of all
                              # objects spawned by the main window ui
                  Severity: Minor
                  Found in guiscrcpy/ux/toolkit.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 validate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def validate(self):
                          # check scrcpy and adb are not None, else replace it with original
                          # values
                          if os.getenv("APPIMAGE") is not None:
                              # no need further configuration for adb, scrcpy and scrcpy_server
                  Severity: Minor
                  Found in guiscrcpy/lib/config.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

                  Severity
                  Category
                  Status
                  Source
                  Language