zhmcclient/zhmccli

View on GitHub

Showing 139 of 191 total issues

Function cmd_loadprofile_list has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_loadprofile_list(cmd_ctx, cpc_name, options):
    # pylint: disable=missing-function-docstring

    client = zhmcclient.Client(cmd_ctx.session)

Severity: Minor
Found in zhmccli/_cmd_loadprofile.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 cmd_user_role_list has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_user_role_list(cmd_ctx, options):
    # pylint: disable=missing-function-docstring

    client = zhmcclient.Client(cmd_ctx.session)
    console = client.consoles.console
Severity: Minor
Found in zhmccli/_cmd_user_role.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 permission_options_to_kwargs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def permission_options_to_kwargs(cmd_ctx, client, options):
    """
    Convert the permission options to a kwargs dict of arguments for the
    respective zhmcclient methods.
    """
Severity: Minor
Found in zhmccli/_cmd_user_role.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 cmd_vstorageresource_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_vstorageresource_list(cmd_ctx, stogrp_name, options):
    # pylint: disable=missing-function-docstring

    client = zhmcclient.Client(cmd_ctx.session)
    stogrp = find_storagegroup(cmd_ctx, client, stogrp_name)
Severity: Minor
Found in zhmccli/_cmd_vstorageresource.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 add_special_options has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def add_special_options(cmd_ctx, console, properties, org_options):
    """
    Add properties from options that need special handling.
    """
    _add_special_name_option(
Severity: Minor
Found in zhmccli/_cmd_user_pattern.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 cmd_lpar_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_lpar_list(cmd_ctx, cpc_name, options):
    # pylint: disable=missing-function-docstring

    client = zhmcclient.Client(cmd_ctx.session)

Severity: Minor
Found in zhmccli/_cmd_lpar.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 cmd_partition_add_crypto has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_partition_add_crypto(cmd_ctx, cpc_name, partition_name, options):
    # pylint: disable=missing-function-docstring

    client = zhmcclient.Client(cmd_ctx.session)
    partition = find_partition(cmd_ctx, client, cpc_name, partition_name)
Severity: Minor
Found in zhmccli/_cmd_partition.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 cmd_capacitygroup_list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_capacitygroup_list(cmd_ctx, cpc_name, options):
    # pylint: disable=missing-function-docstring

    client = zhmcclient.Client(cmd_ctx.session)
    cpc = find_cpc(cmd_ctx, client, cpc_name)
Severity: Minor
Found in zhmccli/_cmd_capacitygroup.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 get_auto_start_list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def get_auto_start_list(cpc):
    """
    Helper functoin that converts the 'auto-start-list' property of a CPC
    to a list suitable for the zhmcclient.Cpc.set_auto_start_list() method.

Severity: Minor
Found in zhmccli/_cmd_cpc.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 click_exception has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def click_exception(exc, error_format):
    """
    Return a ClickException object with the message from an input exception
    in a desired error message format.

Severity: Minor
Found in zhmccli/_helper.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 lpar_scsi_load has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def lpar_scsi_load(cmd_ctx, cpc, lpar, load_address, wwpn, lun, **options):
Severity: Major
Found in zhmccli/_cmd_lpar.py - About 50 mins to fix

    Function cmd_lpar_scsi_dump has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def cmd_lpar_scsi_dump(cmd_ctx, cpc_name, lpar_name, load_address,
    Severity: Major
    Found in zhmccli/_cmd_lpar.py - About 50 mins to fix

      Function lpar_scsi_dump has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def lpar_scsi_dump(cmd_ctx, cpc, lpar, load_address, wwpn, lun, **options):
      Severity: Major
      Found in zhmccli/_cmd_lpar.py - About 50 mins to fix

        Function cmd_lpar_scsi_load has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def cmd_lpar_scsi_load(cmd_ctx, cpc_name, lpar_name, load_address,
        Severity: Major
        Found in zhmccli/_cmd_lpar.py - About 50 mins to fix

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

          def print_dicts_as_table(
          Severity: Minor
          Found in zhmccli/_helper.py - About 45 mins to fix

            Function dict_as_table has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def dict_as_table(data, headers, table_format, show_list=None):
                """
                Return a string with the dictionary data in tabular output format.
            
                The order of rows is ascending by dictionary key.
            Severity: Minor
            Found in zhmccli/_helper.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

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

            def print_resources(
            Severity: Minor
            Found in zhmccli/_helper.py - About 45 mins to fix

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

              def print_resources_as_table(
              Severity: Minor
              Found in zhmccli/_helper.py - About 45 mins to fix

                Function cmd_partition_zeroize_crypto has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def cmd_partition_zeroize_crypto(
                        cmd_ctx, cpc_name, partition_name, options):
                    # pylint: disable=missing-function-docstring
                
                    client = zhmcclient.Client(cmd_ctx.session)
                Severity: Minor
                Found in zhmccli/_cmd_partition.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

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

                def print_object_values(
                Severity: Minor
                Found in zhmccli/_cmd_metrics.py - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language