Showing 303 of 336 total issues
Function post
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def post(self, uri, resource=None, body=None, logon_required=True,
wait_for_completion=False, operation_timeout=None,
renew_session=True):
"""
Perform the HTTP POST method against the resource identified by a URI,
- Read upRead up
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
File _hmc_definitions.py
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2019,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
File _notification.py
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# Copyright 2017,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.
Session
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Session(object):
"""
A session to the HMC, optionally in context of an HMC user.
The session supports operations that require to be authenticated, as well
File _auto_updater.py
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# Copyright 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.
Function _list_with_operation
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def _list_with_operation(
self, list_uri, result_prop, full_properties, filter_args,
additional_properties):
"""
List resource objects by using a List operation.
- Read upRead up
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_permitted_adapters
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def list_permitted_adapters(
self, full_properties=False, filter_args=None,
additional_properties=None):
"""
List the permitted adapters of all CPCs managed by this HMC.
- Read upRead up
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 _setup_metric_group_values
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def _setup_metric_group_values(self):
"""
Return the list of MetricGroupValues objects for this metrics response,
by processing its metrics response string.
- Read upRead up
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 resource
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def resource(self):
"""
:class:`~zhmcclient.BaseResource`: The Python resource object of the
resource these metric values apply to.
- Read upRead up
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_free_crypto_domains
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def get_free_crypto_domains(self, crypto_adapters=None):
"""
Return a list of crypto domains that are free for usage on a list of
crypto adapters in this CPC.
- Read upRead up
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 _log_http_response
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def _log_http_response(
method, url, resource, status, headers=None, content=None):
"""
Log the HTTP response of an HMC REST API call, at the debug level.
- Read upRead up
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 96 lines of code (exceeds 25 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)."""
BaseManager
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class BaseManager(object):
"""
Abstract base class for manager classes (e.g.
:class:`~zhmcclient.CpcManager`).
Function __init__
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, manager, properties):
self._manager = manager # May be None
if properties is not None:
self._properties = copy.deepcopy(properties)
else:
- Read upRead up
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
Partition
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Partition(BaseResource):
"""
Representation of a :term:`Partition`.
Derived from :class:`~zhmcclient.BaseResource`; see there for common
Function _convert_to_config
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _convert_to_config(self, inventory_list, include_unused_adapters):
"""
Convert the inventory list to a DPM configuration dict.
Important: In order to support export of DPM configs with zhmcclient
- Read upRead up
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
File _user_role.py
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright 2017,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
Function __init__
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, manager, properties):
super(FakedAdapter, self).__init__(
manager=manager,
properties=properties)
# Initial values to be prepared for raising InputError
- Read upRead up
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 pull_properties
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def pull_properties(self, properties):
"""
Retrieve the specified set of resource properties from the HMC and
cache them in this Python object.
- Read upRead up
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
File _activation_profile.py
has 298 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