migraf/fhir-kindling

View on GitHub
fhir_kindling/fhir_query/query_response.py

Summary

Maintainability
A
3 hrs
Test Coverage

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

    def included_resources(self) -> List[IncludedResources]:
        """
        Returns the list of resources included in the search.
        Returns:
            List of IncludeResources objects containing the resource type and the list of resources of this type
Severity: Minor
Found in fhir_kindling/fhir_query/query_response.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 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Minor
Found in fhir_kindling/fhir_query/query_response.py - About 35 mins to fix

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

        def _process_server_response(
            self, response: Union[httpx.Response, str, dict]
        ) -> Union[Dict, Bundle, str]:
            """
            Handle the initial response from the server and resolve pagination if necessary.
    Severity: Minor
    Found in fhir_kindling/fhir_query/query_response.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 resources has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def resources(self) -> List[FHIRAbstractModel]:
            """
            List of primary resources returned by the server.
    
            Returns:
    Severity: Minor
    Found in fhir_kindling/fhir_query/query_response.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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def save(
            self, file_path: Union[str, pathlib.Path], output_format: str = "json"
        ) -> None:
            """
            Save the response to a file.
    Severity: Minor
    Found in fhir_kindling/fhir_query/query_response.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

    There are no issues that match your filters.

    Category
    Status