File rackspace.py
has 623 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Rackspace Cloud Files Driver."""
import hashlib
import hmac
import logging
from http import HTTPStatus
CloudFilesDriver
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class CloudFilesDriver(Driver):
"""Driver for interacting with Rackspace Cloud Files.
.. code-block:: python
Function upload_blob
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def upload_blob(
self,
container: Container,
filename: FileLike,
blob_name: str = None,
- 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 generate_container_upload_url
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_container_upload_url(
Function upload_blob
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_blob(
Function _get_server_public_url
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _get_server_public_url(self, service_name: str) -> str:
"""Return the public endpoint URL for a particular service region.
`https://storage101.iad3.clouddrive.com/v1/MossoCloudFS_XXXXX`
- 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 generate_container_upload_url
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def generate_container_upload_url(
self,
container: Container,
blob_name: str,
expires: int = 3600,
- 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 generate_blob_download_url
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_blob_download_url(
Function _make_blob
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _make_blob(self, container, obj) -> Blob:
"""Convert Rackspace Object to a Cloud Storage Blob.
:param container: Container instance.
:type container: :class:`.Container`
- 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"