zhmcclient/zhmccli

View on GitHub

Showing 139 of 191 total issues

Function cmd_vstorageresource_update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    client = zhmcclient.Client(cmd_ctx.session)
    vsr = find_vstorageresource(cmd_ctx, client, stogrp_name, vsr_name)
Severity: Minor
Found in zhmccli/_cmd_vstorageresource.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

Function cmd_cpc_upgrade has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_cpc_upgrade(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_cpc.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

Function parse_ec_levels has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def parse_ec_levels(cmd_ctx, option_name, ec_levels):
    """
    Parse a list of EC levels specified in the command line as a list in
    YAML Flow Collection style, where the list items are strings of the form
    'EC.MCL' where EC is the EC number of the EC stream, and MCL is the MCL
Severity: Minor
Found in zhmccli/_helper.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

Function options_to_properties has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def options_to_properties(options, name_map=None):
    """
    Convert click options into HMC resource properties.

    The click option names in input parameters to this function are the
Severity: Minor
Found in zhmccli/_helper.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

Function cmd_user_pattern_show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_user_pattern_show(cmd_ctx, user_pattern_name):
    # pylint: disable=missing-function-docstring

    client = zhmcclient.Client(cmd_ctx.session)
    console = client.consoles.console
Severity: Minor
Found in zhmccli/_cmd_user_pattern.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

Function cmd_storagegroup_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_storagegroup_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_storagegroup.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

Function cmd_partition_remove_crypto has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def cmd_partition_remove_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 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 {'virtual-switch-uri': vswitch.uri}
Severity: Major
Found in zhmccli/_cmd_nic.py - About 30 mins to fix

    Function get_mcl_str has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_mcl_str(bundle_level, ec_levels, all_, concurrent, install_disruptive):
        """
        Get a string for messages about the MCLs to be installed.
        """
        if install_disruptive:
    Severity: Minor
    Found in zhmccli/_helper.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 cmd_user_role_update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def cmd_user_role_update(cmd_ctx, user_role_name, 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 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 cmd_cpc_autostart_add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def cmd_cpc_autostart_add(cmd_ctx, cpc_name, partitions_delay, options):
        # pylint: disable=missing-function-docstring
        client = zhmcclient.Client(cmd_ctx.session)
        cpc = find_cpc(cmd_ctx, client, cpc_name)
        partition_names, delay = partitions_delay
    Severity: Minor
    Found in zhmccli/_cmd_cpc.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 find_partition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def find_partition(cmd_ctx, client, cpc_name, partition_name):
        """
        Find a partition by name and return its resource object.
        """
        if client.version_info() >= API_VERSION_HMC_2_14_0:
    Severity: Minor
    Found in zhmccli/_cmd_partition.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 cmd_cpc_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def cmd_cpc_list(cmd_ctx, options):
        # pylint: disable=missing-function-docstring
    
        client = zhmcclient.Client(cmd_ctx.session)
    
    
    Severity: Minor
    Found in zhmccli/_cmd_cpc.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 find_lpar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def find_lpar(cmd_ctx, client, cpc_name, lpar_name):
        """
        Find an LPAR by name and return its resource object.
        """
        if client.version_info() >= API_VERSION_HMC_2_14_0:
    Severity: Minor
    Found in zhmccli/_cmd_lpar.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 cmd_nic_update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def cmd_nic_update(cmd_ctx, cpc_name, partition_name, nic_name, options):
        # pylint: disable=missing-function-docstring
    
        client = zhmcclient.Client(cmd_ctx.session)
        nic = find_nic(cmd_ctx, client, cpc_name, partition_name, nic_name)
    Severity: Minor
    Found in zhmccli/_cmd_nic.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_level_str has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_level_str(bundle_level, ftp_host):
        """
        Get a string for messages about the firmware level to be upgraded to,
        including where it comes from.
        """
    Severity: Minor
    Found in zhmccli/_helper.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 cmd_adapter_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def cmd_adapter_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_adapter.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 print_object_values_as_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def print_object_values_as_json(
            cmd_ctx, object_values_list, metric_group_definition):
        """
        Print a list of object values in JSON output format.
        """
    Severity: Minor
    Found in zhmccli/_cmd_metrics.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 cmd_nic_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def cmd_nic_list(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_nic.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