zhmcclient/python-zhmcclient

View on GitHub

Showing 303 of 336 total issues

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

def _sorted(items):
    """
    Returns a sorted version of the given items (if they are dicts/strings).
    """
    sorted_items = items
Severity: Minor
Found in zhmcclient/_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 post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    def add_temporary_capacity(
            self, record_id, software_model=None, processor_info=None,
            test=False, force=False):
        """
        Add temporary processors to the CPC or increase temporary model
Severity: Minor
Found in zhmcclient/_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

Avoid too many return statements within this function.
Open

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

    Avoid too many return statements within this function.
    Open

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

      Avoid too many return statements within this function.
      Open

                              return self.post(
      Severity: Major
      Found in zhmcclient/_session.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

          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

                        Severity
                        Category
                        Status
                        Source
                        Language