srevinsaju/guiscrcpy

View on GitHub
guiscrcpy/cli.py

Summary

Maintainability
C
7 hrs
Test Coverage

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

    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 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 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 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

      There are no issues that match your filters.

      Category
      Status