migraf/fhir-kindling

View on GitHub
fhir_kindling/fhir_server/transactions.py

Summary

Maintainability
B
5 hrs
Test Coverage

Function make_transaction_entry has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def make_transaction_entry(
    method: Union[TransactionMethod, str],
    url: str = None,
    resource: Union[Resource, dict] = None,
) -> BundleEntry:
Severity: Minor
Found in fhir_kindling/fhir_server/transactions.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 _get_transaction_url_for_method has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def _get_transaction_url_for_method(
    method: TransactionMethod, url: str = None, resource: Resource = None
) -> str:
    """
    Get the url for a transaction entry based on the method, url, and resource.
Severity: Minor
Found in fhir_kindling/fhir_server/transactions.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 _validate_transaction_input has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def _validate_transaction_input(
    method: Union[TransactionMethod, str],
    references: Union[List[Reference], List[str]],
    resources: Union[List[Resource], List[dict]],
):
Severity: Minor
Found in fhir_kindling/fhir_server/transactions.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 make_transaction_bundle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def make_transaction_bundle(
    transaction_type: TransactionType = TransactionType.TRANSACTION,
    method: Union[TransactionMethod, str] = TransactionMethod.POST,
    resources: Union[List[Resource], List[dict]] = None,
    references: Union[List[Reference], List[str]] = None,
Severity: Minor
Found in fhir_kindling/fhir_server/transactions.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

There are no issues that match your filters.

Category
Status