scottwernervt/cloudstorage

View on GitHub

Showing 65 of 65 total issues

Function generate_container_upload_url has a Cognitive Complexity of 6 (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/minio.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

Function upload_blob has a Cognitive Complexity of 6 (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/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

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

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`
Severity: Minor
Found in src/cloudstorage/drivers/rackspace.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

Function validate_file_or_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def validate_file_or_path(filename: FileLike) -> Optional[str]:
    """Return filename from file path or from file like object.

    Source: `rackspace/pyrax/object_storage.py <https://github.com/pycontribs/
    pyrax/blob/master/pyrax/object_storage.py>`_
Severity: Minor
Found in src/cloudstorage/helpers.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