scottwernervt/cloudstorage

View on GitHub

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
Severity: Major
Found in src/cloudstorage/base.py - About 2 days to fix

    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
    Severity: Major
    Found in src/cloudstorage/drivers/rackspace.py - About 1 day to fix

      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
      Severity: Major
      Found in src/cloudstorage/drivers/local.py - About 1 day to fix

        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
        
        
        Severity: Minor
        Found in src/cloudstorage/drivers/amazon.py - About 7 hrs to fix

          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
          Severity: Minor
          Found in src/cloudstorage/drivers/minio.py - About 6 hrs to fix

            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
            Severity: Minor
            Found in src/cloudstorage/drivers/google.py - About 5 hrs to fix

              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
              Severity: Minor
              Found in src/cloudstorage/drivers/microsoft.py - About 5 hrs to fix

                CloudFilesDriver has 35 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class CloudFilesDriver(Driver):
                    """Driver for interacting with Rackspace Cloud Files.
                
                    .. code-block:: python
                
                
                Severity: Minor
                Found in src/cloudstorage/drivers/rackspace.py - About 4 hrs to fix

                  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: ::
                  
                  
                  Severity: Minor
                  Found in src/cloudstorage/helpers.py - About 4 hrs 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

                  LocalDriver has 33 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class LocalDriver(Driver):
                      """Driver for interacting with local file-system.
                  
                      .. code-block:: python
                  
                  
                  Severity: Minor
                  Found in src/cloudstorage/drivers/local.py - About 4 hrs to fix

                    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
                    
                    
                    Severity: Minor
                    Found in src/cloudstorage/drivers/amazon.py - About 3 hrs to fix

                      AzureStorageDriver has 27 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class AzureStorageDriver(Driver):
                          """Driver for interacting with Microsoft Azure Storage.
                      
                          .. code-block:: python
                      
                      
                      Severity: Minor
                      Found in src/cloudstorage/drivers/microsoft.py - About 3 hrs to fix

                        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
                        Severity: Minor
                        Found in src/cloudstorage/drivers/google.py - About 3 hrs to fix

                          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
                          Severity: Minor
                          Found in src/cloudstorage/drivers/minio.py - About 3 hrs to fix

                            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::
                            
                            
                            Severity: Minor
                            Found in src/cloudstorage/base.py - About 2 hrs to fix

                              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,
                              Severity: Minor
                              Found in src/cloudstorage/drivers/google.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 __init__ has 14 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(
                              Severity: Major
                              Found in src/cloudstorage/base.py - About 1 hr to fix

                                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,
                                Severity: Minor
                                Found in src/cloudstorage/drivers/amazon.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 _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`
                                Severity: Minor
                                Found in src/cloudstorage/drivers/local.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 upload_blob has 10 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def upload_blob(
                                Severity: Major
                                Found in src/cloudstorage/drivers/minio.py - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language