mardiros/blacksmith

View on GitHub

Showing 36 of 36 total issues

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

    def __init__(
Severity: Major
Found in src/blacksmith/domain/model/params.py - About 50 mins to fix

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

        def __init__(
    Severity: Major
    Found in src/blacksmith/sd/_sync/adapters/consul.py - About 50 mins to fix

      Function scan has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def scan(*modules: str) -> None:
          """
          Collect all resources to fillout the registry.
      
          Basically, it import modules registered using :func:`blacksmith.register`.
      Severity: Minor
      Found in src/blacksmith/domain/scanner.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/blacksmith/middleware/_async/circuit_breaker.py - About 35 mins to fix

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

            def inc_cache_miss(
        Severity: Minor
        Found in src/blacksmith/middleware/_sync/http_cache.py - About 35 mins to fix

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

              def __init__(
          Severity: Minor
          Found in src/blacksmith/middleware/_sync/circuit_breaker.py - About 35 mins to fix

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

                def inc_cache_miss(
            Severity: Minor
            Found in src/blacksmith/middleware/_async/http_cache.py - About 35 mins to fix

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

                  def __init__(
              Severity: Minor
              Found in src/blacksmith/domain/registry.py - About 35 mins to fix

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

                    def __init__(
                Severity: Minor
                Found in src/blacksmith/domain/exceptions.py - About 35 mins to fix

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

                      def observe_cache_hit(
                  Severity: Minor
                  Found in src/blacksmith/middleware/_async/http_cache.py - About 35 mins to fix

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

                        def observe_cache_hit(
                    Severity: Minor
                    Found in src/blacksmith/middleware/_sync/http_cache.py - About 35 mins to fix

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

                          def __init__(
                      Severity: Minor
                      Found in src/blacksmith/domain/exceptions.py - About 35 mins to fix

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

                            def _prepare_request(
                                self,
                                method: HTTPMethod,
                                params: Union[Optional[Request], Dict[Any, Any]],
                                resource: Optional[HttpResource],
                        Severity: Minor
                        Found in src/blacksmith/service/_sync/route_proxy.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 _prepare_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _prepare_request(
                                self,
                                method: HTTPMethod,
                                params: Union[Optional[Request], Dict[Any, Any]],
                                resource: Optional[HttpResource],
                        Severity: Minor
                        Found in src/blacksmith/service/_async/route_proxy.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 __call__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def __call__(self, next: SyncMiddleware) -> SyncMiddleware:
                                def handle(
                                    req: HTTPRequest,
                                    client_name: ClientName,
                                    path: Path,
                        Severity: Minor
                        Found in src/blacksmith/middleware/_sync/http_cache.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 serialize_request_body has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def serialize_request_body(
                            req: "Request", body: Dict[str, str], content_type: Optional[str] = None
                        ) -> RequestBody:
                            """
                            Serialize the body of the request.
                        Severity: Minor
                        Found in src/blacksmith/service/http_body_serializer.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