Showing 65 of 65 total issues
File base.py
has 1107 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
import logging
from abc import abstractmethod
from datetime import datetime
from pathlib import Path
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
File local.py
has 577 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Local File System Driver."""
import errno
import hashlib
import json
import logging
File amazon.py
has 491 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Amazon Simple Storage Service (S3) Driver."""
import logging
from typing import Any, Dict, Iterable, List, TYPE_CHECKING # noqa: F401
from urllib.parse import quote, urljoin
File minio.py
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Minio Driver."""
import logging
import re
from datetime import datetime, timedelta
from typing import Dict, Iterable, List # noqa: F401
File google.py
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Google Cloud Storage Driver."""
import base64
import codecs
import logging
import os
File microsoft.py
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Microsoft Azure Storage Driver."""
import base64
import codecs
import logging
from datetime import datetime, timedelta
CloudFilesDriver
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class CloudFilesDriver(Driver):
"""Driver for interacting with Rackspace Cloud Files.
.. code-block:: python
Function parse_content_disposition
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def parse_content_disposition(data: str) -> Tuple[Optional[str], Dict]:
"""Parse Content-Disposition header.
Example: ::
- 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
LocalDriver
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class LocalDriver(Driver):
"""Driver for interacting with local file-system.
.. code-block:: python
S3Driver
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class S3Driver(Driver):
"""Driver for interacting with Amazon Simple Storage Service (S3).
.. code-block:: python
AzureStorageDriver
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class AzureStorageDriver(Driver):
"""Driver for interacting with Microsoft Azure Storage.
.. code-block:: python
GoogleStorageDriver
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class GoogleStorageDriver(Driver):
"""Driver for interacting with Google Cloud Storage.
The driver will check for `GOOGLE_APPLICATION_CREDENTIALS` environment
variable before connecting. If not found, the driver will use service
MinioDriver
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class MinioDriver(Driver):
"""Driver for interacting with any Minio compatible object storage
server.
.. code-block:: python
Driver
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Driver(metaclass=abc.ABCMeta):
"""Abstract Base Driver Class (:class:`abc.ABCMeta`) to derive from.
.. todo::
Function generate_container_upload_url
has a Cognitive Complexity of 14 (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 __init__
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function upload_blob
has a Cognitive Complexity of 13 (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 _make_blob
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _make_blob(self, container: Container, object_name: str) -> Blob:
"""Convert local file name 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"
Further reading
Function upload_blob
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_blob(