scottwernervt/cloudstorage

View on GitHub

Showing 65 of 65 total issues

Function download_blob has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def download_blob(self, blob: Blob, destination: FileLike) -> None:
        blob_path = self._get_file_path(blob)

        if isinstance(destination, str):
            base_name = os.path.basename(destination)
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 a Cognitive Complexity of 10 (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/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 a Cognitive Complexity of 9 (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/minio.py - About 55 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 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,
Severity: Minor
Found in src/cloudstorage/drivers/rackspace.py - About 55 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 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,
Severity: Minor
Found in src/cloudstorage/drivers/amazon.py - About 55 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 file_checksum has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def file_checksum(
    filename: FileLike, hash_type: str = "md5", block_size: int = 4096
) -> HASH:
    """Returns checksum for file.

Severity: Minor
Found in src/cloudstorage/helpers.py - About 55 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_bucket has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_bucket(self, bucket_name: str, validate: bool = True):
        """Get a S3 bucket.

        :param bucket_name: The Bucket's name identifier.
        :type bucket_name: str
Severity: Minor
Found in src/cloudstorage/drivers/amazon.py - About 45 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 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Minor
Found in src/cloudstorage/drivers/minio.py - About 35 mins to fix

    Function generate_blob_download_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def generate_blob_download_url(
    Severity: Minor
    Found in src/cloudstorage/drivers/microsoft.py - About 35 mins to fix

      Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(
      Severity: Minor
      Found in src/cloudstorage/base.py - About 35 mins to fix

        Function generate_blob_download_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def generate_blob_download_url(
        Severity: Minor
        Found in src/cloudstorage/drivers/amazon.py - About 35 mins to fix

          Function generate_blob_download_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def generate_blob_download_url(
          Severity: Minor
          Found in src/cloudstorage/drivers/rackspace.py - About 35 mins to fix

            Function generate_blob_download_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def generate_blob_download_url(
            Severity: Minor
            Found in src/cloudstorage/base.py - About 35 mins to fix

              Function generate_blob_download_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def generate_blob_download_url(
              Severity: Minor
              Found in src/cloudstorage/drivers/minio.py - About 35 mins to fix

                Function generate_blob_download_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def generate_blob_download_url(
                Severity: Minor
                Found in src/cloudstorage/drivers/local.py - About 35 mins to fix

                  Function generate_blob_download_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def generate_blob_download_url(
                  Severity: Minor
                  Found in src/cloudstorage/drivers/google.py - About 35 mins to fix

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

                        def __init__(
                            self,
                            name: str,
                            checksum: str,
                            etag: str,
                    Severity: Minor
                    Found in src/cloudstorage/base.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __init__(
                            self,
                            name: str,
                            driver: "Driver",
                            acl: str = None,
                    Severity: Minor
                    Found in src/cloudstorage/base.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 file_content_type has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def file_content_type(filename: FileLike) -> Optional[str]:
                        """Guess content type for file path or file like object.
                    
                        :param filename: File path or file like object.
                        :type filename: str or file
                    Severity: Minor
                    Found in src/cloudstorage/helpers.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 create_container has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def create_container(
                            self, container_name: str, acl: str = None, meta_data: MetaData = None
                        ) -> Container:
                            meta_data = meta_data if meta_data is not None else {}
                    
                    
                    Severity: Minor
                    Found in src/cloudstorage/drivers/microsoft.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