zhmcclient/python-zhmcclient

View on GitHub

Showing 303 of 336 total issues

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

    def _add_vault_data(self, hmc_vault, inv_file):
        """
        Add data from HMC vault file to each host of all groups.

        Parameters:
Severity: Minor
Found in zhmcclient/testutils/_hmc_definitions.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 list_attached_storage_groups has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def list_attached_storage_groups(self, full_properties=False):
        """
        Return the storage groups that are attached to this partition.

        The CPC must have the "dpm-storage-management" feature enabled.
Severity: Minor
Found in zhmcclient/_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 install_and_activate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def install_and_activate(
            self, bundle_level=None, ec_levels=None,
            install_disruptive=False, wait_for_completion=True,
            operation_timeout=None):
        """
Severity: Minor
Found in zhmcclient/_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

Severity
Category
Status
Source
Language