scottwernervt/cloudstorage

View on GitHub
src/cloudstorage/base.py

Summary

Maintainability
F
4 days
Test Coverage

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

    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 __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 10 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

          Function generate_container_upload_url has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            Function generate_upload_url has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

              Function upload_blob has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def upload_blob(
              Severity: Major
              Found in src/cloudstorage/base.py - About 1 hr 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/base.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

                    There are no issues that match your filters.

                    Category
                    Status