zhmcclient/python-zhmcclient

View on GitHub

Showing 303 of 336 total issues

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

def parse_query_parms(method, uri):
    """
    Parse the specified URI with optional query parms and return the URI
    without query parms and a dictionary of query parms.

Severity: Minor
Found in zhmcclient_mock/_urihandler.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 delete has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def delete(
            self, uri, resource=None, logon_required=True, renew_session=True):
        """
        Perform the HTTP DELETE method against the resource identified by a
        URI.
Severity: Minor
Found in zhmcclient/_session.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 logged_api_call has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def logged_api_call(func):
    """
    Function decorator that causes the decorated API function or method to log
    calls to itself to a logger.

Severity: Minor
Found in zhmcclient/_logging.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 from_hmc_dict has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def from_hmc_dict(hmc_dict, filepath=None, userid=None, password=None):
        """
        Return a new FakedSession object from an HMC definition dictionary.

        An HMC definition dictionary can be created using
Severity: Minor
Found in zhmcclient_mock/_session.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 wait_for_completion has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def wait_for_completion(self, operation_timeout=None):
        """
        Wait for completion of the job, then delete the job on the HMC and
        return the result of the original asynchronous HMC operation, if it
        completed successfully.
Severity: Minor
Found in zhmcclient/_session.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 nvme_dump has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def nvme_dump(self, load_address, load_parameter=None,
Severity: Major
Found in zhmcclient/_lpar.py - About 1 hr to fix

    Function post has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def post(method, hmc, uri, uri_parms, body, logon_required,
                 wait_for_completion):
            # pylint: disable=unused-argument
            """Operation: Decrease Crypto Configuration (requires DPM mode)."""
            assert wait_for_completion is True  # async not supported yet
    Severity: Minor
    Found in zhmcclient_mock/_urihandler.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 get_metric_values_response has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_metric_values_response(self):
            """
            Get the faked metrics, for all metric groups and all resources that
            have been prepared on the manager object of this context object, as a
            string in the format needed for the "Get Metrics" operation response.
    Severity: Minor
    Found in zhmcclient_mock/_hmc.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 post has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def post(method, hmc, uri, uri_parms, body, logon_required,
                 wait_for_completion):
            # pylint: disable=unused-argument
            """Operation: Create Partition (requires DPM mode)."""
    
    
    Severity: Minor
    Found in zhmcclient_mock/_urihandler.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 get has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

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

        def get(cls, method, hmc, uri, uri_parms, logon_required):
            # pylint: disable=unused-argument
            """
            Operation: List Load Activation Profiles.
            In case of DPM mode, an empty list is returned.
    Severity: Minor
    Found in zhmcclient_mock/_urihandler.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 _request_exc_message has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    def _request_exc_message(exc):
        """
        Return a reasonable exception message from a
        :exc:`request.exceptions.RequestException` exception.
    
    
    Severity: Minor
    Found in zhmcclient/_session.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 _manager_uri_from_notification has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def _manager_uri_from_notification(self, headers):
            """
            Return the manager URI from the headers of an inventory notification
            and the resource URI.
            """
    Severity: Minor
    Found in zhmcclient/_auto_updater.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 scsi_load has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def scsi_load(self, load_address, wwpn, lun, load_parameter=None,
                      disk_partition_id=None,
                      operating_system_specific_load_parameters=None,
                      boot_record_logical_block_address=None, force=False,
                      wait_for_completion=True, operation_timeout=None,
    Severity: Minor
    Found in zhmcclient/_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 get has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        def get(cls, method, hmc, uri, uri_parms, logon_required):
            # pylint: disable=unused-argument
            """
            Operation: List Reset Activation Profiles.
            In case of DPM mode, an empty list is returned.
    Severity: Minor
    Found in zhmcclient_mock/_urihandler.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 single_step_install has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def single_step_install(
    Severity: Major
    Found in zhmcclient/_console.py - About 1 hr to fix

      Function wait_for_available has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def wait_for_available(self, operation_timeout=None):
              """
              Wait for the Console (HMC) this client is connected to, to become
              available. The Console is considered available if the
              :meth:`~zhmcclient.Client.query_api_version` method succeeds.
      Severity: Minor
      Found in zhmcclient/_client.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 __init__ has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self, hmc, parent, resource_class, base_uri, oid_prop,
      Severity: Major
      Found in zhmcclient_mock/_hmc.py - About 1 hr to fix

        Function load_from_ftp has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def load_from_ftp(
        Severity: Major
        Found in zhmcclient/_lpar.py - About 1 hr to fix

          Function load has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def load(self, load_address=None, load_parameter=None,
          Severity: Major
          Found in zhmcclient/_lpar.py - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language