zhmcclient/python-zhmcclient

View on GitHub

Showing 336 of 336 total issues

Avoid too many return statements within this function.
Open

                    return
Severity: Major
Found in zhmcclient/_auto_updater.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return False
    Severity: Major
    Found in zhmcclient/_utils.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return None
      Severity: Major
      Found in zhmcclient/_manager.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return None
        Severity: Major
        Found in zhmcclient/_manager.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                      return resource_obj
          Severity: Major
          Found in zhmcclient/_manager.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return None
            Severity: Major
            Found in zhmcclient/_manager.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return
              Severity: Major
              Found in zhmcclient/_auto_updater.py - About 30 mins to fix

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

                    def get(cls, method, hmc, uri, uri_parms, logon_required):
                        # pylint: disable=unused-argument
                        """Operation: List Storage Groups (always global but with filters)."""
                        uri, query_parms = parse_query_parms(method, uri)
                        check_invalid_query_parms(
                Severity: Minor
                Found in zhmcclient_mock/_urihandler.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(self, manager, properties):
                        super(FakedCpc, self).__init__(
                            manager=manager,
                            properties=properties)
                        self._lpars = FakedLparManager(hmc=manager.hmc, cpc=self)
                Severity: Minor
                Found in zhmcclient_mock/_hmc.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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def get(cls, method, hmc, uri, uri_parms, logon_required):
                        # pylint: disable=unused-argument
                        """Operation: List CPCs."""
                        uri, query_parms = parse_query_parms(method, uri)
                        check_invalid_query_parms(
                Severity: Minor
                Found in zhmcclient_mock/_urihandler.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 post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def post(method, hmc, uri, uri_parms, body, logon_required,
                             wait_for_completion):
                        # pylint: disable=unused-argument
                        """Operation: Change Adapter Type (requires DPM mode)."""
                        assert wait_for_completion is True  # HMC operation is synchronous
                Severity: Minor
                Found in zhmcclient_mock/_urihandler.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_assigned_partitions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def list_assigned_partitions(self, full_properties=False, filter_args=None):
                        """
                        List the partitions assigned to this adapter.
                
                        This method is not supported for OSA adapters configured as OSM
                Severity: Minor
                Found in zhmcclient/_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 list_candidate_adapter_ports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    def list_candidate_adapter_ports(self, full_properties=False):
                        """
                        Return the current candidate storage adapter port list of this FCP
                        storage group.
                
                
                Severity: Minor
                Found in zhmcclient/_storage_group.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 _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