zhmcclient/python-zhmcclient

View on GitHub
zhmcclient/_lpar.py

Summary

Maintainability
F
1 wk
Test Coverage

File _lpar.py has 1703 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Copyright 2016,2021 IBM Corp. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Severity: Major
Found in zhmcclient/_lpar.py - About 4 days to fix

    Lpar has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Lpar(BaseResource):
        """
        Representation of an :term:`LPAR`.
    
        Derived from :class:`~zhmcclient.BaseResource`; see there for common
    Severity: Minor
    Found in zhmcclient/_lpar.py - About 2 hrs to fix

      Function scsi_load has 15 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Function scsi_dump has 14 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          Function nvme_load has 12 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            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 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 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

                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 scsi_dump has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def scsi_dump(self, load_address, wwpn, lun, load_parameter=None,
                                    disk_partition_id=None,
                                    operating_system_specific_load_parameters=None,
                                    boot_record_logical_block_address=None, os_ipl_token=None,
                                    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 activate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def activate(self, wait_for_completion=True,
                                   operation_timeout=None, status_timeout=None,
                                   allow_status_exceptions=False, activation_profile_name=None,
                                   force=False):
                          """
                  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 nvme_load has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def nvme_load(self, load_address, load_parameter=None, secure_boot=False,
                                    clear_indicator=True, 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 wait_for_status has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def wait_for_status(self, status, status_timeout=None):
                          """
                          Wait until the status of this LPAR has a desired value.
                  
                          Parameters:
                  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 nvme_dump has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def nvme_dump(self, load_address, load_parameter=None,
                                    secure_boot=False, 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 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 reset_normal has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def reset_normal(self, force=False, wait_for_completion=True,
                  Severity: Minor
                  Found in zhmcclient/_lpar.py - About 45 mins to fix

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

                        def load(self, load_address=None, load_parameter=None,
                                 clear_indicator=True, store_status_indicator=False,
                                 wait_for_completion=True, operation_timeout=None,
                                 status_timeout=None, allow_status_exceptions=False,
                                 force=False):
                    Severity: Minor
                    Found in zhmcclient/_lpar.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 activate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def activate(self, wait_for_completion=True,
                    Severity: Minor
                    Found in zhmcclient/_lpar.py - About 45 mins to fix

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

                          def reset_clear(self, force=False, wait_for_completion=True,
                      Severity: Minor
                      Found in zhmcclient/_lpar.py - About 45 mins to fix

                        Function deactivate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def deactivate(self, wait_for_completion=True,
                        Severity: Minor
                        Found in zhmcclient/_lpar.py - About 35 mins to fix

                          Function list_os_messages has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def list_os_messages(
                          Severity: Minor
                          Found in zhmcclient/_lpar.py - About 35 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status